/* ==========================================================================
   NERTHYS NETWORK — STAFF PANEL DESIGN SYSTEM (APPLE-LIKE & COSMIC)
   ========================================================================== */

:root {
  /* Fondo y Superficies */
  --bg-space: #07070A;
  --bg-deep: #0B0B10;
  --bg-surface: rgba(18, 18, 26, 0.72);
  --bg-surface-elevated: rgba(26, 26, 38, 0.82);
  --bg-card: rgba(20, 20, 30, 0.65);
  --bg-input: rgba(12, 12, 18, 0.6);

  /* Acentos de Nerthys Gold & Amber */
  --gold-primary: #F4C542;
  --gold-hover: #FFD768;
  --gold-glow: rgba(244, 197, 66, 0.28);
  --gold-subtle: rgba(244, 197, 66, 0.1);
  --gold-border: rgba(244, 197, 66, 0.32);

  /* Colores de Estado y Roles */
  --role-superadmin: #F4C542;
  --role-owner: #FFD166;
  --role-admin: #EF4444;
  --role-mod: #A855F7;
  --role-helper: #38BDF8;

  --status-emerald: #10B981;
  --status-emerald-glow: rgba(16, 185, 129, 0.25);
  --status-amber: #F59E0B;
  --status-rose: #F43F5E;

  /* Textos */
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-dim: #475569;

  /* Bordes de Cristal */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(244, 197, 66, 0.5);

  /* Tipografías */
  --font-display: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Sombras Apple-like */
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
  --shadow-floating: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-medium);
  --shadow-gold-button: 0 4px 20px rgba(244, 197, 66, 0.25);

  /* Curvas y Transiciones */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --spring-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--bg-space);
  color: var(--text-primary);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  background-color: var(--bg-space);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Lienzo de estrellas cósmicas */
#cosmic-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* Resplandores ambientales de fondo */
.ambient-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}

.glow-top {
  top: -200px;
  right: -100px;
  background: radial-gradient(circle, var(--gold-primary) 0%, transparent 70%);
}

.glow-bottom {
  bottom: -200px;
  left: -100px;
  background: radial-gradient(circle, #5865F2 0%, transparent 70%);
}

/* Contenedor Principal */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   ESTILOS DE CRISTAL (GLASSMORPHISM APPLE-LIKE)
   ========================================================================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s var(--spring-ease), box-shadow 0.3s var(--spring-ease);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   VISTA 1: PANTALLA DE LOGIN
   ========================================================================== */
.view-section {
  width: 100%;
  min-height: 100vh;
  transition: opacity 0.4s var(--spring-ease), transform 0.4s var(--spring-ease);
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 36px;
  background: rgba(16, 16, 24, 0.88);
  border: 1px solid rgba(244, 197, 66, 0.18);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.75), 0 0 45px rgba(244, 197, 66, 0.08);
  animation: cardFadeIn 0.6s var(--spring-ease);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--gold-subtle);
  border: 1px solid var(--gold-border);
  color: var(--gold-primary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
}

.brand-logo-glow {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

/* Logo oficial de Nerthys */
.login-brand-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(244, 197, 66, 0.45));
  transition: transform 0.35s var(--spring-ease), filter 0.35s var(--spring-ease);
}

.login-brand-logo:hover {
  transform: scale(1.08) rotate(2deg);
  filter: drop-shadow(0 0 30px rgba(244, 197, 66, 0.65));
}

.nav-brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(244, 197, 66, 0.4));
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Alertas */
.alert-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 22px;
  animation: shake 0.4s var(--spring-ease);
}

.alert-box.error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #FDA4AF;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Formularios Apple-Like */
.apple-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #CBD5E1;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.input-wrapper input,
.select-wrapper select {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s var(--spring-ease);
}

.input-wrapper input:hover,
.select-wrapper select:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(16, 16, 24, 0.8);
}

.input-wrapper input:focus,
.select-wrapper select:focus {
  border-color: var(--gold-primary);
  background: rgba(16, 16, 24, 0.95);
  box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.15);
}

.select-wrapper select {
  padding-left: 16px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.select-wrapper select option {
  background: #111118;
  color: #FFF;
}

.btn-toggle-pass,
.btn-copy-input {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-xs);
  transition: color 0.2s, transform 0.2s;
}

.btn-toggle-pass:hover,
.btn-copy-input:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

/* Botones Apple-like */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.3s var(--spring-ease);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-hover) 0%, var(--gold-primary) 100%);
  color: #08080C;
  box-shadow: var(--shadow-gold-button);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #FFE285 0%, var(--gold-hover) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(244, 197, 66, 0.4);
}

.btn-gold:active {
  transform: translateY(0);
}

.btn-compact {
  padding: 9px 18px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-medium);
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--gold-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-text-link:hover {
  text-decoration: underline;
}

.login-footer {
  margin-top: 26px;
  display: flex;
  justify-content: center;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Spinner de Carga */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   VISTA 2: CAMBIO OBLIGATORIO DE CONTRASEÑA
   ========================================================================== */
.force-pass-card {
  border-color: rgba(245, 158, 11, 0.3);
}

.warning-badge {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #FBBF24;
}

.warning-dot {
  background: #FBBF24;
  box-shadow: 0 0 8px #FBBF24;
}

.key-icon-wrapper {
  display: flex;
  justify-content: center;
  color: #FBBF24;
  margin-bottom: 12px;
}

.highlight-user {
  color: var(--gold-primary);
}

.strength-meter {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.strength-bar {
  height: 100%;
  width: 0%;
  transition: width 0.3s, background-color 0.3s;
}

.strength-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   VISTA 3: NAVBAR Y DASHBOARD
   ========================================================================== */
.panel-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(11, 11, 16, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.brand-tag {
  font-size: 0.7rem;
  color: var(--gold-primary);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.db-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  color: #A7F3D0;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-emerald);
}

.live-dot.pulse {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
}

.user-avatar-frame {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #1A1A24;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-border);
}

.user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gold-primary);
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   BADGES DE ROLES Y JERARQUÍA OFICIAL (9 RANGOS DE NERTHYS)
   ========================================================================== */
.user-role-badge {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
}

/* 👑 SuperOwner & Dueño — Mismo aspecto visual (Dorado Oficial) */
.badge-superowner,
.badge-owner {
  background: rgba(244, 197, 66, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(244, 197, 66, 0.45);
  box-shadow: 0 0 10px rgba(244, 197, 66, 0.25);
}

/* ⚡ Manager — Naranja Fuego */
.badge-manager {
  background: rgba(249, 115, 22, 0.15);
  color: #FB923C;
  border: 1px solid rgba(249, 115, 22, 0.45);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.2);
}

/* 🛡️ Administrador — Rojo Carmesí */
.badge-admin {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* 🛡️ JrAdmin — Rosa Carmesí */
.badge-jradmin {
  background: rgba(251, 113, 133, 0.15);
  color: #FB7185;
  border: 1px solid rgba(251, 113, 133, 0.4);
}

/* 🔮 SrMod — Púrpura Imperial */
.badge-srmod {
  background: rgba(168, 85, 247, 0.15);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* 🔮 Mod — Violeta */
.badge-mod {
  background: rgba(129, 140, 248, 0.15);
  color: #A5B4FC;
  border: 1px solid rgba(129, 140, 248, 0.4);
}

/* 💠 JrMod — Cyan */
.badge-jrmod {
  background: rgba(6, 182, 212, 0.15);
  color: #22D3EE;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

/* 💙 Ayudante — Azul Cielo */
.badge-ayudante,
.badge-helper {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

/* Barra de Modo Simulación (Ver como otro rango) */
.preview-mode-bar {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.15) 0%, rgba(244, 197, 66, 0.15) 100%);
  border-bottom: 1px solid rgba(249, 115, 22, 0.35);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #FED7AA;
  animation: slideDown 0.3s var(--spring-ease);
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.preview-mode-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-mode-tag {
  font-weight: 700;
  color: var(--gold-primary);
}

.btn-reset-preview {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset-preview:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #FFF;
}

/* Selector en la barra de navegación */
.preview-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.preview-selector-wrap select {
  background: none;
  border: none;
  color: var(--gold-primary);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.preview-selector-wrap select option {
  background: #111118;
  color: #FFF;
}

.btn-icon-logout {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--spring-ease);
}

.btn-icon-logout:hover {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
  color: #FB7185;
}

/* ==========================================================================
   PANEL CONTENIDO Y MÉTRICAS
   ========================================================================== */
.panel-content {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Rejilla de Métricas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.stat-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(18, 18, 26, 0.6);
}

.stat-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gold-wrap {
  background: rgba(244, 197, 66, 0.12);
  color: var(--gold-primary);
  border: 1px solid rgba(244, 197, 66, 0.25);
}

.emerald-wrap {
  background: rgba(16, 185, 129, 0.12);
  color: var(--status-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.purple-wrap {
  background: rgba(168, 85, 247, 0.12);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-number-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-subpill {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.text-emerald { color: var(--status-emerald); }
.text-cyan { color: #38BDF8; }
.text-gold { color: var(--gold-primary); }

/* ==========================================================================
   TABLA DE MIEMBROS DEL STAFF
   ========================================================================== */
.roster-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrap input {
  padding: 9px 16px 9px 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  width: 240px;
  transition: all 0.2s;
}

.search-input-wrap input:focus {
  border-color: var(--gold-primary);
  width: 280px;
  box-shadow: 0 0 0 2px rgba(244, 197, 66, 0.15);
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.apple-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.apple-table thead {
  background: rgba(14, 14, 20, 0.7);
  border-bottom: 1px solid var(--border-subtle);
}

.apple-table th {
  padding: 16px 20px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  font-weight: 600;
}

.apple-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.apple-table tbody tr {
  transition: background-color 0.2s;
}

.apple-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.text-right {
  text-align: right;
}

/* Celda de Usuario con Skin */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cell-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #111118;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.cell-username {
  font-weight: 600;
  color: var(--text-primary);
}

/* Badges de estado */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.pill-green {
  background: rgba(16, 185, 129, 0.12);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pill-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pill-red {
  background: rgba(244, 63, 94, 0.12);
  color: #FDA4AF;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Botones de acción en tabla */
.action-buttons-group {
  display: inline-flex;
  gap: 8px;
}

.btn-table-action {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-action-danger:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.35);
  color: #FB7185;
}

.table-loading {
  text-align: center;
  padding: 40px !important;
  color: var(--text-muted);
}

/* ==========================================================================
   MODALES APPLE-LIKE
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.3s var(--spring-ease);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 32px;
  background: rgba(18, 18, 28, 0.95);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-floating);
  animation: modalPop 0.3s var(--spring-ease);
}

@keyframes modalPop {
  from { transform: scale(0.95) translateY(10px); }
  to { transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title-row {
  display: flex;
  gap: 14px;
}

.modal-badge-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--gold-subtle);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.warning-badge-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.btn-close-modal:hover {
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: rgba(22, 22, 32, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  animation: toastSlideIn 0.3s var(--spring-ease);
  transition: transform 0.2s, opacity 0.2s;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
}

.toast.error {
  border-color: rgba(244, 63, 94, 0.4);
}

@keyframes toastSlideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   TABS DE NAVEGACIÓN DEL PANEL
   ========================================================================== */
.panel-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 14, 20, 0.7);
  border: 1px solid var(--border-medium);
  padding: 6px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow-x: auto;
  scrollbar-width: none;
}

.panel-tabs-bar::-webkit-scrollbar {
  display: none;
}

.panel-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s var(--spring-ease);
}

.panel-tab-btn svg {
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.panel-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.panel-tab-btn:hover svg {
  opacity: 1;
  transform: scale(1.08);
}

.panel-tab-btn.active {
  background: rgba(244, 197, 66, 0.12);
  border-color: rgba(244, 197, 66, 0.35);
  color: var(--gold-primary);
  box-shadow: 0 4px 18px rgba(244, 197, 66, 0.15);
}

.panel-tab-btn.active svg {
  opacity: 1;
  stroke: var(--gold-primary);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 9999px;
  color: inherit;
}

.tab-perm-badge {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tab-free-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.tab-pane {
  animation: tabFadeIn 0.3s var(--spring-ease) forwards;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   TARJETA DE BLOQUEO POR PERMISOS (PERMISSION LOCKED)
   ========================================================================== */
.permission-locked-card {
  text-align: center;
  padding: 60px 24px;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  margin: 20px 0;
  animation: tabFadeIn 0.3s var(--spring-ease);
}

.locked-icon-box {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #EF4444;
}

.locked-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.locked-desc {
  max-width: 540px;
  margin: 0 auto;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   ESTILOS DE NOTICIAS & COMUNICADOS
   ========================================================================== */
.badge-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.live-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
}

.news-thumb-img {
  width: 58px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.tag-news-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-primary);
  border: 1px solid var(--gold-border);
  background: var(--gold-subtle);
  padding: 2px 8px;
  border-radius: 4px;
}

.category-news-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.news-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

.news-status-published {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.news-status-draft {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.modal-card-wide {
  max-width: 780px !important;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.image-preset-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-preset-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preset-pill:hover {
  background: rgba(244, 197, 66, 0.15);
  border-color: rgba(244, 197, 66, 0.4);
  color: var(--gold-primary);
}

/* ==========================================================================
   CONFIGURACIÓN DE AVISO GLOBAL (ALERT TAB)
   ========================================================================== */
.alert-grid-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.toggle-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.toggle-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.toggle-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.preview-card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.preview-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.live-preview-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 20px;
}

.preview-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(244, 197, 66, 0.06);
  border: 1px solid rgba(244, 197, 66, 0.2);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--gold-primary);
  line-height: 1.5;
}

/* ==========================================================================
   HERRAMIENTAS DE SOPORTE & MODERACIÓN
   ========================================================================== */
.support-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.full-width-card {
  grid-column: 1 / -1;
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.tool-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cyan-wrap {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #06B6D4;
}

.red-wrap {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #EF4444;
}

.purple-wrap {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #A855F7;
}

.tool-card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #FFFFFF;
}

.tool-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.tool-search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tool-search-row .input-wrapper {
  flex: 1;
}

.player-lookup-result-box {
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.player-skin-preview {
  width: 90px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-full-skin {
  height: 140px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7));
  object-fit: contain;
}

.player-lookup-info {
  flex: 1;
}

.lookup-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.lookup-badge-row {
  margin-bottom: 16px;
}

.badge-mini {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #22D3EE;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.lookup-actions-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-mini {
  padding: 6px 14px !important;
  font-size: 0.82rem !important;
}

/* Calculadora de Sanciones */
.sanction-result-box {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 14px;
}

.sanction-result-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sanction-type-pill {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.sanction-duration-pill {
  background: rgba(244, 197, 66, 0.15);
  border: 1px solid rgba(244, 197, 66, 0.35);
  color: var(--gold-primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}

.sanction-cmd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 8, 12, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  gap: 10px;
}

.sanction-cmd-row code {
  color: #38BDF8;
  font-size: 0.88rem;
  word-break: break-all;
}

/* Plantillas de Soporte */
.canned-responses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.canned-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.canned-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.04);
}

.canned-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.canned-header h4 {
  font-size: 0.95rem;
  color: #FFFFFF;
  font-weight: 700;
}

.btn-copy-template {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #C084FC;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-template:hover {
  background: rgba(168, 85, 247, 0.3);
  color: #FFFFFF;
}

.canned-preview {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Telemetría */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.telemetry-icon-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.telemetry-icon-dot.green {
  background: #10B981;
  box-shadow: 0 0 12px #10B981;
}

.telemetry-icon-dot.gold {
  background: #F4C542;
  box-shadow: 0 0 12px #F4C542;
}

.telemetry-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.telemetry-val {
  font-size: 0.88rem;
  color: #FFFFFF;
  font-weight: 600;
  margin-top: 3px;
}

/* ==========================================================================
   REGISTRO DE AUDITORÍA (AUDIT TABLE)
   ========================================================================== */
.audit-action-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.audit-login-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.audit-login-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.audit-news {
  background: rgba(244, 197, 66, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(244, 197, 66, 0.3);
}

.audit-admin {
  background: rgba(168, 85, 247, 0.15);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.audit-details-code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s var(--spring-ease);
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s var(--spring-ease);
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--gold-primary);
}

input:checked + .slider:before {
  transform: translateX(24px);
  background-color: #08080C;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
  .panel-navbar {
    padding: 12px 16px;
  }

  .nav-left .db-live-indicator {
    display: none;
  }

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

  .section-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-actions {
    width: 100%;
    flex-direction: column;
  }

  .search-input-wrap,
  .search-input-wrap input {
    width: 100% !important;
  }

  .btn-compact {
    width: 100%;
  }

  .login-card {
    padding: 32px 20px;
  }
}
