/* ============================================================
   HEADER - LAYOUT BASE CORRECTO
   ============================================================
   Desktop: grid auto 1fr auto
   Móvil: flex space-between
   Altura fija 64px, sin trucos
   ============================================================ */

/* Mobile Sheet Container - Contenedor global para bottom sheets */
.mobile-sheet-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  pointer-events: none;
}

.mobile-sheet-container[aria-hidden="false"] {
  pointer-events: auto;
}

/* Mobile Sheet Backdrop - Fondo oscuro */
.mobile-sheet-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.mobile-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Sheet - Panel deslizante */
.mobile-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  background: var(--neo-surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  pointer-events: none;
  z-index: 2;
  padding: 0;
}

.mobile-sheet.active {
  transform: translateY(0);
  pointer-events: auto;
}

/* Contenido dentro del mobile-sheet debe ser visible */
.mobile-sheet > * {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  position: relative;
}

/* Ocultar dropdowns originales cuando están en mobile-sheet */
@media (max-width: 1023px) {
  .user-dropdown,
  .mini-config-dropdown,
  .notifications-dropdown,
  .language-selector-dropdown,
  #adminMenuDropdownMobile {
    display: none !important;
  }
  
  /* Mostrar solo cuando están dentro de mobile-sheet */
  .mobile-sheet .user-dropdown,
  .mobile-sheet .mini-config-dropdown,
  .mobile-sheet .notifications-dropdown,
  .mobile-sheet .language-selector-dropdown,
  .mobile-sheet #adminMenuDropdownMobile {
    display: block !important;
    position: relative;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    z-index: auto;
    left: auto;
    right: auto;
    bottom: auto;
    top: auto;
    width: auto;
    max-width: auto;
    max-height: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
}

/* Backdrops: cuando no están visibles no deben interceptar clics (evita bloqueo en admin/resto) */
.dropdown-backdrop:not(.show),
.header-dd-backdrop:not(.show) {
  pointer-events: none !important;
  visibility: hidden !important;
  display: none !important;
}

/* Decoración del header 100% en CSS (variables en variables.css / neo.css) */
.header {
  position: sticky;
  top: 0;
  z-index: 9999;
  height: 64px;
  padding: 0 16px;
  background: var(--neo-background);
  border-bottom: 1px solid var(--neo-border);
  box-shadow: 0 4px 16px var(--neo-header-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-sizing: border-box;
  overflow: visible;
}

/* ============================================================
   DESKTOP (≥1024px) - GRID auto 1fr auto
   ============================================================ */
@media (min-width: 1024px) {
  .header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
  }

  /* Header Left - Identidad (min-width: 0 para que el logo no se corte en grid) */
  .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
  }

  /* Header Nav - Navegación */
  .header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    min-width: 0;
  }

  /* Header Right - Acciones */
  .header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Ajustar gap entre contadores y separador */
  .counter-group {
    margin-right: 0;
  }

  .header-separator {
    margin-left: 4px;
    margin-right: 4px;
  }

  /* Ocultar elementos móviles */
  .mobile-only,
  .mobile-left,
  .mobile-right,
  .logo-toggle-btn {
    display: none !important;
  }
}

/* ============================================================
   MÓVIL (max-width: 1023px) - FLEX space-between
   ============================================================ */
@media (max-width: 1023px) {
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 64px;
    max-height: 64px;
    min-height: 64px;
    flex-shrink: 0;
  }

  /* Ocultar elementos desktop */
  .header-left,
  .header-nav,
  .header-right {
    display: none !important;
  }

  /* Mobile Left - Identidad: ocupa solo el espacio restante, nunca solapa a mobile-right */
  .mobile-left {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: flex 0.3s ease, max-width 0.3s ease;
    overflow: hidden;
  }

  .mobile-left:not(.logo-collapsed) {
    max-width: 100%;
  }

  /* Asegurar que el botón toggle tenga espacio suficiente */
  .logo-toggle-btn {
    margin-right: 0;
  }

  /* Botón toggle para colapsar logo (solo móvil) - PEQUEÑO Y DELGADO */
  .logo-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 6px;
    background: var(--neo-surface) !important;
    border: 1px solid var(--neo-border) !important;
    color: var(--neo-text) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
  }

  .logo-toggle-btn:hover {
    background: var(--neo-surface-hover, var(--neo-surface)) !important;
    border-color: var(--neo-border-hover, var(--neo-border)) !important;
    transform: translateY(-1px);
  }

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

  .logo-toggle-btn i {
    font-size: 11px;
    transition: transform 0.3s ease;
    display: block;
    line-height: 1;
  }

  /* Estado colapsado: botón rota 180° */
  .mobile-left.logo-collapsed .logo-toggle-btn i {
    transform: rotate(180deg);
  }

  /* Logo colapsado: solo icono visible con transición */
  .logo-content {
    transition: opacity 0.25s ease, max-width 0.25s ease, margin 0.25s ease, padding 0.25s ease;
    overflow: hidden;
    white-space: nowrap;
    display: block;
  }

  .mobile-left.logo-collapsed .logo-content {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    max-width: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }
  
  /* Ocultar todos los hijos del logo-content cuando está colapsado */
  .mobile-left.logo-collapsed .logo-content * {
    display: none !important;
    visibility: hidden !important;
  }

  /* Ocultar completamente después de la transición */
  .mobile-left.logo-collapsed .logo-content * {
    display: none;
  }

  /* Asegurar que el logo-icon siempre sea visible */
  .mobile-left.logo-collapsed .logo-icon {
    display: flex !important;
    visibility: visible !important;
  }

  .mobile-left.logo-collapsed .logo {
    gap: 0;
  }

  /* Cuando el logo está colapsado, mobile-left ocupa menos espacio */
  .mobile-left.logo-collapsed {
    flex: 0 0 auto;
    min-width: auto;
    max-width: fit-content;
    width: auto;
  }

  /* Logo colapsado: solo icono, sin gap extra */
  .mobile-left.logo-collapsed .logo {
    width: auto;
    min-width: auto;
  }

  /* Asegurar que el logo-icon en estado colapsado tenga el tamaño correcto y esté centrado */
  .mobile-left.logo-collapsed .logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: grid !important;
    place-items: center !important;
    align-self: center !important;
  }

  /* Centrar el logo cuando está colapsado */
  .mobile-left.logo-collapsed .logo {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Asegurar que el logo colapsado no interfiera con el escalado */
  .mobile-left.logo-collapsed .logo {
    transform: none !important;
  }

  .mobile-left.logo-collapsed .logo.scale-95,
  .mobile-left.logo-collapsed .logo.scale-90,
  .mobile-left.logo-collapsed .logo.scale-85,
  .mobile-left.logo-collapsed .logo.scale-80,
  .mobile-left.logo-collapsed .logo.scale-75 {
    transform: none !important;
  }

  /* Mobile Right - Acciones: ancho fijo según contenido, nunca se solapa con mobile-left */
  .mobile-right {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
    flex-shrink: 0;
    align-items: center;
    min-width: 0;
    transition: justify-content 0.3s ease, flex 0.3s ease;
  }

  /* Cuando el logo está colapsado, centrar los botones */
  .header.logo-collapsed .mobile-left {
    flex: 0 0 auto;
    max-width: fit-content;
    min-width: auto;
  }

  .header.logo-collapsed .mobile-right {
    flex: 1;
    justify-content: center;
    margin-left: 0;
    padding-left: 0;
  }

  .header.logo-collapsed {
    justify-content: space-between;
    gap: 0;
  }

  /* Asegurar que no haya colisión entre botón toggle y logo colapsado */
  .mobile-left.logo-collapsed {
    gap: 8px;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  /* Asegurar que el botón toggle esté centrado verticalmente */
  .mobile-left.logo-collapsed .logo-toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
  }
}

/* ============================================================
   LOGO - Estilos base
   ============================================================ */
  .logo {
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
    text-decoration: none;
    min-width: 0;
    flex-shrink: 1;
    max-width: 100%;
    overflow: hidden;
  }

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent));
  display: grid;
  place-items: center;
  color: #0b0f19;
  box-shadow: var(--neo-shadow);
  flex-shrink: 0;
  font-size: 14px;
}

.logo-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.logo-title-row {
  display: flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
  margin-top: 2px;
}

.logo-text {
  font-weight: 800;
  letter-spacing: 0;
  color: var(--neo-text);
  font-size: 10px;
  white-space: nowrap;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.logo-subtitle-row {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  margin-top: 1px;
}

/* Badge versión (header/footer): color permanente, mismo en modo claro y oscuro */
.beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border-radius: 3px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  border: 0.5px solid rgba(71, 85, 105, 0.45) !important;
  background: linear-gradient(180deg, rgba(71, 85, 105, 0.18), rgba(71, 85, 105, 0.08)) !important;
  color: #475569 !important;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.1;
  margin-left: 3px;
}
html[data-mode="dark"] .beta-badge {
  border-color: rgba(148, 163, 184, 0.5) !important;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.22), rgba(148, 163, 184, 0.1)) !important;
  color: #94a3b8 !important;
}

.logo-subtitle {
  font-size: 7px;
  color: var(--neo-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  line-height: 1.1;
}

/* ============================================================
   NAV-LINKS - Botones de navegación
   ============================================================ */
/* Iniciar sesión usa el mismo estilo que el resto de botones del header (ver BOTONES DEL HEADER) */

.nav-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--neo-muted);
  text-decoration: none;
  transition: 0.2s all ease;
  white-space: nowrap;
}

.nav-link i {
  opacity: 0.8;
}

/* Hover de nav-link: no aplicar a botón de login (usa estilo unificado del header) */
.nav-link:hover:not(.btn-login-header),
.nav-link.active:not(.btn-login-header) {
  color: var(--neo-text);
  background: rgba(0,0,0,.06);
}

/* Foro y MarketPlace: Coming soon (PC) */
.nav-link.coming-soon {
  cursor: default;
  opacity: 0.75;
  pointer-events: none;
}
.nav-link.coming-soon:hover {
  background: transparent;
  color: var(--neo-muted);
}
/* Badge "Próximamente": color permanente, mismo en modo claro y oscuro */
.nav-coming-soon-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(71, 85, 105, 0.2) !important;
  color: #475569 !important;
  margin-left: 4px;
  border: 1px solid rgba(71, 85, 105, 0.45) !important;
}
html[data-mode="dark"] .nav-coming-soon-badge {
  background: rgba(148, 163, 184, 0.22) !important;
  color: #94a3b8 !important;
  border-color: rgba(148, 163, 184, 0.45) !important;
}

/* ============================================================
   CONTADORES - Counter group
   ============================================================ */
.counter-group {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.03);
  flex-shrink: 0;
}

.counter-group .counter-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  color: var(--neo-text);
  font-size: 12px;
  background: transparent;
}

.counter-group .counter-chip i {
  opacity: 0.9;
  font-size: 12px;
}

.counter-group .counter-chip .label {
  display: none !important; /* Nunca mostrar labels en desktop */
}

.counter-group .counter-chip strong {
  font-weight: 700;
  font-size: 12px;
}

.counter-group .divider {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,.10);
}

/* Separador inteligente entre contadores y acciones */
.header-separator {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,.08);
  margin: 0 8px;
  flex-shrink: 0;
  display: none; /* Oculto por defecto */
}

/* Solo mostrar si hay contadores antes */
.counter-group + .header-separator {
  display: block;
}

@media (max-width: 1023px) {
  .header-separator {
    display: none !important;
  }
}

html[data-mode="light"] .header-separator {
  background: rgba(0,0,0,.08);
}

/* ============================================================
   BOTONES DEL HEADER - Estilo temático
   ============================================================ */
/* Estilo unificado: todos los botones de acción del header (PC y móvil) */
.header button,
.header a.header-btn,
.header a.btn-login-header,
.header .icon-btn,
.header .menu-toggle,
.header .user-menu-toggle,
.header .mini-config-toggle,
.header .notifications-toggle,
.header .language-selector-toggle,
.header .theme-selector-toggle,
.header .header-dd-toggle,
.mobile-login-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  min-height: 44px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--neo-text) !important;
  background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent)) !important;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}
.mobile-login-btn:hover {
  background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent)) !important;
  color: var(--neo-text) !important;
  filter: brightness(1.1);
  transform: translateY(-1px);
}
@media (max-width: 479px) {
  .mobile-login-text { display: none; }
  .mobile-login-btn { padding: 8px; min-width: 44px; width: 44px; }
}

.mobile-right button,
.mobile-right a.header-btn,
.mobile-right .icon-btn,
.mobile-right .menu-toggle,
.mobile-right .user-menu-toggle,
.mobile-right .mini-config-toggle,
.mobile-right .notifications-toggle,
.mobile-right .language-selector-toggle,
.mobile-right .theme-selector-toggle,
.mobile-right .header-dd-toggle {
  border-radius: 12px !important;
  background: var(--neo-surface) !important;
  color: var(--neo-text) !important;
  border: 1px solid var(--neo-border) !important;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Centrar iconos dentro de los botones en móvil */
.mobile-right button i,
.mobile-right a.header-btn i,
.mobile-right .icon-btn i,
.mobile-right .menu-toggle i,
.mobile-right .user-menu-toggle i,
.mobile-right .mini-config-toggle i,
.mobile-right .notifications-toggle i,
.mobile-right .language-selector-toggle i,
.mobile-right .theme-selector-toggle i,
.mobile-right .header-dd-toggle i {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  line-height: 1 !important;
}

/* Desktop (header-right): mismo hover para todos – gradiente + brillo + ligera elevación */
.header .header-right button:hover,
.header .header-right a.btn-login-header:hover,
.header .header-right .mini-config-toggle:hover,
.header .header-right .notifications-toggle:hover,
.header .header-right .language-selector-toggle:hover,
.header .header-right .theme-selector-toggle:hover,
.header .header-right .header-dd-toggle:hover,
.header .header-right .user-menu-toggle:hover {
  background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent)) !important;
  border-color: transparent !important;
  color: var(--neo-text) !important;
  filter: brightness(1.1);
  transform: translateY(-1px);
}
/* Móvil (mobile-right): hover con surface y transición */
.mobile-right button:hover,
.mobile-right a.header-btn:hover,
.mobile-right .icon-btn:hover,
.mobile-right .menu-toggle:hover,
.mobile-right .user-menu-toggle:hover,
.mobile-right .mini-config-toggle:hover,
.mobile-right .notifications-toggle:hover,
.mobile-right .language-selector-toggle:hover,
.mobile-right .theme-selector-toggle:hover,
.mobile-right .header-dd-toggle:hover {
  background: var(--neo-surface-hover, var(--neo-surface)) !important;
  border-color: var(--neo-border-hover, var(--neo-border)) !important;
  transform: translateY(-1px);
}

.header button:active,
.header a.header-btn:active,
.header a.btn-login-header:active,
.header .icon-btn:active,
.header .menu-toggle:active,
.header .user-menu-toggle:active,
.header .mini-config-toggle:active,
.header .notifications-toggle:active,
.header .language-selector-toggle:active,
.header .theme-selector-toggle:active,
.header .header-dd-toggle:active,
.mobile-right button:active,
.mobile-right a.header-btn:active,
.mobile-right .icon-btn:active,
.mobile-right .menu-toggle:active,
.mobile-right .user-menu-toggle:active,
.mobile-right .mini-config-toggle:active,
.mobile-right .notifications-toggle:active,
.mobile-right .language-selector-toggle:active,
.mobile-right .theme-selector-toggle:active,
.mobile-right .header-dd-toggle:active {
  transform: translateY(0);
}

/* ============================================================
   DROPDOWNS - Wrappers y paneles
   ============================================================ */
.header-dd-wrap {
  position: relative;
  overflow: visible;
}

.header-dd-chevron {
  transition: transform 0.2s ease;
}

.header-dd-wrap.open .header-dd-chevron {
  transform: rotate(180deg);
}

.user-menu.open .user-menu-chevron,
.user-menu.open .header-dd-chevron {
  transform: rotate(180deg);
}

/* ============================================================
   DESKTOP - Tamaños y estilos específicos
   ============================================================ */
@media (min-width: 1024px) {
  .logo {
    max-width: none;
    flex-direction: row;
  }

  .logo-content {
    overflow: visible;
    max-width: none;
    flex-direction: column;
  }

  .logo-text {
    font-size: 16px;
  }

  .logo-subtitle {
    font-size: 11px;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }

  .beta-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .mini-config-toggle {
    padding: 8px 12px;
    min-height: 40px;
    gap: 6px;
    font-size: 13px;
  }

  .mini-config-text {
    display: inline-block;
    font-size: 15px;
    white-space: nowrap;
    margin-left: 4px;
    font-weight: 500;
  }

  .mini-config-chevron {
    display: inline-block;
    font-size: 10px;
    margin-left: 6px;
  }

  .user-menu-toggle {
    padding: 6px 10px;
    min-height: 40px;
    gap: 8px;
    font-size: inherit;
  }

  .user-menu-toggle .user-name {
    display: inline-block;
    font-size: 15px !important;
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    margin-left: 6px;
  }

  .user-menu-toggle .user-menu-chevron {
    display: inline-block;
    font-size: 10px;
    margin-left: 6px;
  }

  .user-menu-toggle .user-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    flex-shrink: 0;
    object-fit: cover;
    object-position: center;
  }

  .notifications-toggle {
    padding: 8px 12px;
    min-width: 40px;
    min-height: 40px;
    font-size: 14px;
  }

  .language-selector-toggle {
    padding: 8px 12px;
    min-height: 40px;
    gap: 6px;
    font-size: 13px;
  }

  .language-selector-toggle span {
    display: inline-block;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 6px;
    text-transform: uppercase;
    font-weight: 600;
  }

  .language-selector-toggle i.fa-chevron-down {
    display: inline-block;
    font-size: 10px;
    margin-left: 6px;
  }

  .counter-group .counter-chip .label {
    display: inline;
  }

  /* Dropdowns desktop: absolute, anclados al botón */
  .header-dd-panel,
  .mini-config-dropdown,
  .user-dropdown,
  .notifications-dropdown,
  .language-selector-dropdown,
  #adminMenuDropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    width: auto !important;
    min-width: 200px !important;
    max-width: 90vw !important;
    max-height: 70vh !important;
    background: var(--neo-surface) !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.04) !important;
    padding: 10px !important;
    z-index: 1000 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    display: none !important;
  }

  .mini-config-dropdown {
    min-width: 300px !important;
    max-width: 380px !important;
    padding: 14px !important;
  }

  .user-dropdown {
    min-width: 200px !important;
    max-width: 280px !important;
  }

  .notifications-dropdown {
    min-width: 340px !important;
    max-width: 400px !important;
  }

  .language-selector-dropdown,
  #adminMenuDropdown {
    min-width: 180px !important;
    max-width: 240px !important;
  }

  .header-dd-panel::before,
  .mini-config-dropdown::before,
  .user-dropdown::before,
  .notifications-dropdown::before,
  .language-selector-dropdown::before {
    display: none !important;
  }

  .header-dd-panel.open,
  .header-dd-panel.show,
  .mini-config-dropdown.open,
  .mini-config-dropdown.show,
  .user-dropdown.open,
  .notifications-dropdown.open,
  .notifications-dropdown.show,
  .language-selector-dropdown.open,
  #adminMenuDropdown.open {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  /* Scroll decorado en desplegables del header */
  .header-dd-panel::-webkit-scrollbar,
  .mini-config-dropdown::-webkit-scrollbar,
  .user-dropdown::-webkit-scrollbar,
  .notifications-dropdown::-webkit-scrollbar,
  .language-selector-dropdown::-webkit-scrollbar {
    width: 8px;
  }
  .header-dd-panel::-webkit-scrollbar-track,
  .mini-config-dropdown::-webkit-scrollbar-track,
  .user-dropdown::-webkit-scrollbar-track,
  .notifications-dropdown::-webkit-scrollbar-track,
  .language-selector-dropdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
  }
  .header-dd-panel::-webkit-scrollbar-thumb,
  .mini-config-dropdown::-webkit-scrollbar-thumb,
  .user-dropdown::-webkit-scrollbar-thumb,
  .notifications-dropdown::-webkit-scrollbar-thumb,
  .language-selector-dropdown::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.4);
    border-radius: 4px;
  }
  .header-dd-panel::-webkit-scrollbar-thumb:hover,
  .mini-config-dropdown::-webkit-scrollbar-thumb:hover,
  .user-dropdown::-webkit-scrollbar-thumb:hover,
  .notifications-dropdown::-webkit-scrollbar-thumb:hover,
  .language-selector-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.6);
  }

  .dropdown-backdrop,
  .header-dd-backdrop {
    display: none !important;
  }
}

/* ============================================================
   MÓVIL - Escalado dinámico del logo (múltiples niveles)
   ============================================================ */
@media (max-width: 1023px) {
  .logo.scale-95 {
    transform: scale(0.95);
  }

  .logo.scale-90 {
    transform: scale(0.9);
  }

  .logo.scale-85 {
    transform: scale(0.85);
  }

  .logo.scale-80 {
    transform: scale(0.8);
  }

  .logo.scale-75 {
    transform: scale(0.75);
  }

  /* El transform scale ya escala todo proporcionalmente, no necesitamos cambiar tamaños individuales */

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    transition: width 0.2s ease, height 0.2s ease, font-size 0.2s ease;
  }

  .logo-text {
    font-size: 13px;
    transition: font-size 0.2s ease;
  }

  .logo-subtitle {
    font-size: 9px;
    max-width: 180px;
    transition: font-size 0.2s ease;
  }

  .beta-badge {
    font-size: 8px;
    padding: 2px 5px;
    transition: font-size 0.2s ease, padding 0.2s ease;
  }

  /* Tamaños base antes de escalar */
  .logo {
    transform-origin: left center;
  }

  .mini-config-toggle {
    padding: 4px 6px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
    font-size: 13px;
  }

  .mini-config-text {
    display: none !important;
  }

  .mini-config-chevron {
    display: none !important;
  }

  .user-menu-toggle {
    padding: 4px 6px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
    align-items: center;
    gap: 0 !important;
  }

  .user-menu-toggle .user-name {
    display: none !important;
  }

  .user-menu-toggle .user-menu-chevron {
    display: none !important;
  }

  .user-menu-toggle .user-avatar {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    flex-shrink: 0;
    object-fit: cover;
    object-position: center;
  }

  .notifications-toggle {
    padding: 4px 6px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 13px;
  }

  .language-selector-toggle {
    padding: 4px 6px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 13px;
  }

  .language-selector-toggle span {
    display: none !important;
  }

  .language-selector-toggle i.fa-chevron-down {
    display: none !important;
  }

  .counter-group {
    display: none !important;
  }
}

/* ============================================================
   MÓVIL GRANDE / TABLET (600px–1023px): header fijo, logo como móvil, botones más grandes
   Icono, título, subtítulo y versión se mantienen con el mismo aspecto que en móvil.
   ============================================================ */
@media (min-width: 600px) and (max-width: 1023px) {
  .header {
    height: 64px;
    max-height: 64px;
    min-height: 64px;
  }

  /* Logo: mismo layout que en móvil – bloque compacto, icono + título/subtítulo alineados en una sola fila */
  .mobile-left {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
  }

  .mobile-left .logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: center;
    justify-content: flex-start;
    gap: 6px;
  }

  .mobile-left .logo-icon {
    align-self: center;
    flex-shrink: 0;
  }

  .mobile-left .logo-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  .mobile-left .logo-title-row {
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .mobile-left .logo-subtitle-row {
    margin-top: 1px;
    margin-bottom: 0;
    line-height: 1.1;
  }

  .mobile-right button,
  .mobile-right a.header-btn,
  .mobile-right a.mobile-login-btn,
  .mobile-right .icon-btn,
  .mobile-right .menu-toggle,
  .mobile-right .user-menu-toggle,
  .mobile-right .mini-config-toggle,
  .mobile-right .notifications-toggle,
  .mobile-right .language-selector-toggle,
  .mobile-right .theme-selector-toggle,
  .mobile-right .header-dd-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 6px 8px;
    font-size: 14px;
  }
  .mobile-right a.mobile-login-btn { width: auto; min-width: 44px; padding: 8px 12px; }

  .mobile-right button i,
  .mobile-right a.header-btn i,
  .mobile-right .icon-btn i,
  .mobile-right .menu-toggle i,
  .mobile-right .user-menu-toggle i,
  .mobile-right .mini-config-toggle i,
  .mobile-right .notifications-toggle i,
  .mobile-right .language-selector-toggle i,
  .mobile-right .theme-selector-toggle i,
  .mobile-right .header-dd-toggle i {
    font-size: 14px;
  }

  .mini-config-toggle,
  .user-menu-toggle,
  .notifications-toggle,
  .language-selector-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 6px 8px;
    font-size: 14px;
  }

  .mobile-right .user-menu-toggle {
    justify-content: center;
    align-items: center;
  }

  .user-menu-toggle .user-avatar {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    flex-shrink: 0;
    object-fit: cover;
    object-position: center;
  }
}

/* ============================================================
   BOTTOM SHEETS MÓVILES
   ============================================================ */
@media (max-width: 1023px) {
  /* Backdrop oscuro */
  .dropdown-backdrop,
  .header-dd-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .dropdown-backdrop.show,
  .header-dd-backdrop.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  html[data-mode="light"] .dropdown-backdrop,
  html[data-mode="light"] .header-dd-backdrop {
    background: rgba(0, 0, 0, 0.3);
  }

  /* Bottom Sheet */
  .user-dropdown,
  .mini-config-dropdown,
  .notifications-dropdown,
  .language-selector-dropdown,
  #adminMenuDropdownMobile {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    background: var(--neo-surface);
    border: none;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,.4);
    padding: 20px 16px;
    padding-top: 12px;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Handle visual */
  .user-dropdown::before,
  .mini-config-dropdown::before,
  .notifications-dropdown::before,
  .language-selector-dropdown::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 5px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    z-index: 1;
  }

  html[data-mode="light"] .user-dropdown::before,
  html[data-mode="light"] .mini-config-dropdown::before,
  html[data-mode="light"] .notifications-dropdown::before,
  html[data-mode="light"] .language-selector-dropdown::before {
    background: rgba(0, 0, 0, 0.2);
  }

  /* Estado abierto */
  .user-menu.open #userDropdown,
  .user-dropdown.open,
  .mini-config-dropdown.open,
  .notifications-dropdown.open,
  .language-selector-dropdown.open,
  #adminMenuDropdownMobile.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

/* ============================================================
   USER DROPDOWN HEADER (icono grande, nombre, email)
   ============================================================ */
.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  margin-bottom: 4px;
}

.user-dropdown-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--neo-border);
}

.user-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-dropdown-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--neo-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-email {
  font-size: 13px;
  color: var(--neo-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 1024px) {
  .user-dropdown-header {
    padding: 12px 14px;
  }

  .user-dropdown-avatar {
    width: 48px;
    height: 48px;
  }

  .user-dropdown-name {
    font-size: 15px;
  }

  .user-dropdown-email {
    font-size: 12px;
  }
}

/* ============================================================
   DROPDOWN ITEMS
   ============================================================ */
.dropdown-item,
.language-option,
.theme-option {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  color: var(--neo-text);
  text-decoration: none;
  border-radius: 12px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
  font-size: 15px;
  cursor: pointer;
}

.dropdown-item:hover,
.language-option:hover,
.theme-option:hover {
  background: rgba(255,255,255,.08);
  transform: translateX(4px);
}

.dropdown-item i,
.language-option i,
.theme-option i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  opacity: 0.8;
}

@media (min-width: 1024px) {
  .dropdown-item,
  .language-option,
  .theme-option {
    padding: 10px 12px;
    font-size: 14px;
    min-height: auto;
  }

  .dropdown-item i,
  .language-option i,
  .theme-option i {
    font-size: 14px;
    width: 18px;
  }
}

/* ============================================================
   MINI-CONFIG DROPDOWN CONTENT
   ============================================================ */
.mini-config-section {
  margin-bottom: 16px;
}

.mini-config-section:last-child {
  margin-bottom: 0;
}

.mini-config-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--neo-text);
  border-bottom: 1px solid var(--neo-border);
  margin-bottom: 12px;
}

.mini-config-section-header i {
  opacity: 0.8;
  font-size: 16px;
}

.mini-config-divider {
  height: 1px;
  background: var(--neo-border);
  margin: 16px 0;
}

.language-selector-inline,
.theme-selector-inline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.language-selector-inline .language-option,
.theme-selector-inline .theme-option {
  padding: 12px 14px;
  font-size: 15px;
}

.current-language-display,
.current-theme-display {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--neo-muted);
  text-align: center;
  margin-top: 8px;
  background: rgba(255,255,255,.03);
  border-radius: 8px;
}

/* Custom Theme Panel */
.custom-panel {
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255,255,255,.02);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.05);
}

.custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.custom-row > label {
  font-weight: 600;
  font-size: 12px;
  color: var(--neo-text);
  margin-right: 4px;
}

.custom-row input[type="color"] {
  width: 40px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.custom-row input[type="color"]:hover {
  border-color: rgba(255,255,255,.2);
  transform: scale(1.1);
}

.custom-row input[type="color"]:focus {
  outline: none;
  border-color: var(--neo-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,.2);
}

.custom-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent));
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.custom-apply-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

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

.custom-apply-btn i {
  font-size: 11px;
}

.theme-tabs {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}

.theme-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03);
  color: var(--neo-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.theme-tab:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.15);
  color: var(--neo-text);
}

.theme-tab.active {
  background: var(--neo-primary);
  border-color: var(--neo-primary);
  color: #fff !important;
}

.theme-tab.active i {
  color: #fff !important;
}

html[data-mode="light"] .theme-tab.active {
  color: #000 !important;
  background: var(--neo-primary);
  border-color: var(--neo-primary);
  mix-blend-mode: normal;
}

html[data-mode="light"] .theme-tab.active i {
  color: #000 !important;
}

html[data-mode="light"] .theme-tab.active {
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

html[data-mode="dark"] .theme-tab.active {
  color: #fff !important;
  background: var(--neo-primary);
  border-color: var(--neo-primary);
}

html[data-mode="dark"] .theme-tab.active i {
  color: #fff !important;
}

.theme-tab i {
  font-size: 11px;
}

.theme-list-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.theme-list-inline .theme-option {
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.theme-list-inline .theme-option .theme-name {
  display: block;
  font-weight: 500;
  font-size: 13px;
  color: var(--neo-text);
}

.theme-list-inline .theme-option .theme-desc {
  display: block;
  opacity: 0.7;
  font-size: 11px;
  color: var(--neo-muted);
}

.theme-list-inline .theme-option:hover {
  background: rgba(255,255,255,.08) !important;
  transform: translateX(2px);
}

html[data-mode="light"] .custom-panel {
  background: color-mix(in srgb, var(--neo-primary) 3%, var(--neo-surface));
  border-color: var(--neo-border);
}

html[data-mode="light"] .custom-row input[type="color"] {
  border-color: var(--neo-border);
  background: var(--neo-surface-2);
}

html[data-mode="light"] .custom-row input[type="color"]:hover {
  border-color: color-mix(in srgb, var(--neo-primary) 30%, transparent);
}

html[data-mode="light"] .theme-tab {
  border-color: var(--neo-border);
  background: color-mix(in srgb, var(--neo-primary) 4%, var(--neo-surface));
}

html[data-mode="light"] .theme-tab:hover {
  background: color-mix(in srgb, var(--neo-primary) 8%, var(--neo-surface));
  border-color: color-mix(in srgb, var(--neo-primary) 20%, transparent);
}

html[data-mode="light"] .theme-list-inline .theme-option:hover {
  background: color-mix(in srgb, var(--neo-primary) 8%, var(--neo-surface)) !important;
}

/* Estilo de fuentes - Mini-Config */
.font-list-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-right: 4px;
}

.font-list-inline::-webkit-scrollbar {
  width: 6px;
}

.font-list-inline::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.2);
  border-radius: 3px;
}

.font-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: rgba(255,255,255,.03);
}

.font-option:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.1);
}

.font-option.active {
  background: color-mix(in srgb, var(--neo-primary) 18%, transparent);
  border-color: var(--neo-primary);
}

.font-option .font-preview {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--neo-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.font-custom-input {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--neo-border);
  background: rgba(255,255,255,.05);
  color: var(--neo-text);
  font-size: 13px;
}

.font-custom-input::placeholder {
  color: var(--neo-muted);
  opacity: 0.8;
}

.font-custom-input:focus {
  outline: none;
  border-color: var(--neo-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.font-add-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.font-file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.font-file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.font-upload-btn {
  cursor: pointer;
  white-space: nowrap;
  margin: 0;
}

.font-custom-hint {
  font-size: 11px;
  color: var(--neo-muted);
  margin: 0 0 8px 0;
  opacity: 0.9;
}

.current-font-display {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--neo-muted);
  text-align: center;
  margin-top: 4px;
  background: rgba(255,255,255,.03);
  border-radius: 8px;
}

/* Alto contraste - fila y toggle */
.high-contrast-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 4px !important;
  margin-top: 8px !important;
  width: 100% !important;
  border-top: 1px solid var(--neo-border) !important;
}

.high-contrast-toggle {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  cursor: pointer !important;
  flex: 1 !important;
  font-size: 14px !important;
  color: var(--neo-text) !important;
  user-select: none !important;
}

.high-contrast-toggle input {
  position: absolute !important;
  width: 0.1px !important;
  height: 0.1px !important;
  opacity: 0 !important;
}

.high-contrast-toggle .toggle-slider {
  flex-shrink: 0 !important;
  width: 38px !important;
  height: 20px !important;
  background: rgba(255,255,255,.1) !important;
  border-radius: 20px !important;
  transition: .3s !important;
  position: relative !important;
  border: 1px solid var(--neo-border) !important;
}

.high-contrast-toggle .toggle-slider::before {
  content: "" !important;
  position: absolute !important;
  width: 14px !important;
  height: 14px !important;
  left: 3px !important;
  top: 2px !important;
  background: #fff !important;
  border-radius: 50% !important;
  transition: .3s !important;
}

.high-contrast-toggle input:checked + .toggle-slider {
  background: var(--neo-primary) !important;
  border-color: var(--neo-primary) !important;
}

.high-contrast-toggle input:checked + .toggle-slider::before {
  transform: translateX(18px) !important;
}

/* Ajustes para móvil */
@media (max-width: 768px) {
  .high-contrast-row {
    padding: 12px 8px !important;
  }
  .high-contrast-toggle {
    font-size: 15px !important;
  }
}


html[data-mode="light"] .font-option {
  background: color-mix(in srgb, var(--neo-primary) 4%, var(--neo-surface));
}

html[data-mode="light"] .font-option:hover {
  background: color-mix(in srgb, var(--neo-primary) 10%, var(--neo-surface));
}

html[data-mode="light"] .font-option.active {
  background: color-mix(in srgb, var(--neo-primary) 20%, var(--neo-surface));
  border-color: var(--neo-primary);
}

html[data-mode="light"] .font-custom-input {
  background: var(--neo-surface-2);
  border-color: var(--neo-border);
  color: var(--neo-text);
}

/* ============================================================
   MODO CLARO - Ajustes generales
   ============================================================ */
html[data-mode="light"] .header {
  background: var(--neo-surface) !important;
  border-bottom: 1px solid var(--neo-border);
  box-shadow: 0 4px 16px var(--neo-header-shadow);
}

html[data-mode="light"] .counter-group {
  background: color-mix(in srgb, var(--neo-primary) 4%, var(--neo-surface));
  border-color: var(--neo-border);
}

html[data-mode="light"] .counter-group .divider {
  background: var(--neo-border);
}

html[data-mode="light"] .user-avatar {
  border-color: var(--neo-border);
}

html[data-mode="light"] .language-selector-dropdown,
html[data-mode="light"] .theme-selector-dropdown {
  background: var(--neo-surface);
  border-color: var(--neo-border);
}

html[data-mode="light"] .language-option:hover,
html[data-mode="light"] .theme-option:hover {
  background: color-mix(in srgb, var(--neo-primary) 8%, var(--neo-surface));
}

/* Forzar dropdowns en oscuro para no mezclar con tema claro */
html[data-mode="dark"] .mini-config-dropdown,
html[data-mode="dark"] .user-dropdown,
html[data-mode="dark"] .language-selector-dropdown,
html[data-mode="dark"] .theme-selector-dropdown,
html[data-mode="dark"] .notifications-dropdown {
  background: var(--neo-surface) !important;
  border-color: var(--neo-border) !important;
  color: var(--neo-text) !important;
}
html[data-mode="dark"] .mini-config-dropdown *,
html[data-mode="dark"] .theme-selector-dropdown * { color: inherit; }
html[data-mode="dark"] .mini-config-section-header,
html[data-mode="dark"] .theme-option,
html[data-mode="dark"] .language-option { color: var(--neo-text); }

html[data-mode="light"] .mini-config-dropdown,
html[data-mode="light"] .user-dropdown,
html[data-mode="light"] .language-selector-dropdown {
  background: var(--neo-surface, #c5cfde) !important;
  border-color: var(--neo-border, rgba(0,0,0,.08));
  color: var(--neo-text) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
}

html[data-mode="light"] .mini-config-dropdown::before,
html[data-mode="light"] .user-dropdown::before,
html[data-mode="light"] .language-selector-dropdown::before {
  background: color-mix(in srgb, var(--neo-primary) 15%, transparent);
}

html[data-mode="light"] .mini-config-section-header {
  border-bottom-color: var(--neo-border);
}

html[data-mode="light"] .mini-config-divider {
  background: var(--neo-border);
}

html[data-mode="light"] .nav-link:hover,
html[data-mode="light"] .nav-link.active {
  background: color-mix(in srgb, var(--neo-primary) 8%, var(--neo-surface));
}

/* beta-badge light: definido arriba con color fijo */

/* ============================================================
   ACCESIBILIDAD Y TÁCTIL
   ============================================================ */
.user-menu-toggle,
.mini-config-toggle,
.notifications-toggle,
.menu-toggle {
  -webkit-tap-highlight-color: rgba(124, 58, 237, 0.2);
  touch-action: manipulation;
}

@media (hover: none) and (pointer: coarse) {
  .user-menu-toggle:active,
  .mini-config-toggle:active,
  .notifications-toggle:active,
  .menu-toggle:active {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  .header *,
  .user-menu-toggle,
  .mini-config-toggle,
  .notifications-toggle {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================
   ESTADO DESACTIVADO CON BOTTOM SHEET ABIERTO
   ============================================================ */
body.has-mobile-sheet-open .header button,
body.has-mobile-sheet-open .header .icon-btn,
body.has-mobile-sheet-open .header .menu-toggle,
body.has-mobile-sheet-open .header .user-menu-toggle,
body.has-mobile-sheet-open .header .mini-config-toggle,
body.has-mobile-sheet-open .header .notifications-toggle,
body.has-mobile-sheet-open .header .language-selector-toggle,
body.has-mobile-sheet-open .header .theme-selector-toggle,
body.has-mobile-sheet-open .header .header-dd-toggle,
body.has-mobile-sheet-open .mobile-right button,
body.has-mobile-sheet-open .mobile-right .icon-btn,
body.has-mobile-sheet-open .mobile-right .menu-toggle,
body.has-mobile-sheet-open .mobile-right .user-menu-toggle,
body.has-mobile-sheet-open .mobile-right .mini-config-toggle,
body.has-mobile-sheet-open .mobile-right .notifications-toggle,
body.has-mobile-sheet-open .mobile-right .language-selector-toggle,
body.has-mobile-sheet-open .mobile-right .theme-selector-toggle,
body.has-mobile-sheet-open .mobile-right .header-dd-toggle {
  opacity: 0.6 !important;
  pointer-events: none !important;
}

/* ============================================================
   MODAL DE INFORMACIÓN DEL LOGO (MÓVIL - LONG PRESS)
   ============================================================ */
.logo-info-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Cuando el modal está oculto, asegurar que los elementos no puedan recibir foco */
.logo-info-modal[aria-hidden="true"],
.logo-info-modal[inert] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.logo-info-modal[aria-hidden="true"] *,
.logo-info-modal[inert] * {
  pointer-events: none !important;
}

.logo-info-modal[aria-hidden="false"] {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
  visibility: visible !important;
}

.logo-info-modal[aria-hidden="false"] * {
  pointer-events: auto;
  visibility: visible !important;
}

.logo-info-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.logo-info-modal-content {
  position: relative;
  background: var(--neo-background);
  border-radius: 20px;
  padding: 24px;
  max-width: 90%;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--neo-border);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.logo-info-modal[aria-hidden="false"] .logo-info-modal-content {
  transform: scale(1);
}

.logo-info-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--neo-surface);
  border: 1px solid var(--neo-border);
  color: var(--neo-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 1;
}

.logo-info-modal-close:hover {
  background: var(--neo-surface-hover, var(--neo-surface));
  transform: rotate(90deg);
}

.logo-info-header {
  text-align: center;
  margin-bottom: 24px;
  padding-top: 8px;
}

.logo-info-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--neo-primary), var(--neo-accent));
  display: grid;
  place-items: center;
  color: #0b0f19;
  box-shadow: var(--neo-shadow);
  margin: 0 auto 16px;
  font-size: 32px;
}

.logo-info-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--neo-text);
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.logo-info-subtitle {
  font-size: 14px;
  color: var(--neo-text-secondary);
  margin: 0;
  line-height: 1.5;
}

.logo-info-version-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--neo-border);
}

.logo-info-version-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.logo-info-version-label {
  font-size: 14px;
  color: var(--neo-text-secondary);
  font-weight: 500;
}

.logo-info-version-current {
  font-size: 14px;
  color: var(--neo-primary);
  font-weight: 700;
  background: var(--neo-surface);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--neo-border);
}

.logo-info-version-dropdown {
  position: relative;
}

.logo-info-version-toggle {
  width: 100%;
  padding: 12px 16px;
  background: var(--neo-surface);
  border: 1px solid var(--neo-border);
  border-radius: 12px;
  color: var(--neo-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.logo-info-version-toggle:hover {
  background: var(--neo-surface-hover, var(--neo-surface));
  border-color: var(--neo-border-hover, var(--neo-border));
}

.logo-info-version-toggle i {
  transition: transform 0.3s ease;
}

.logo-info-version-dropdown[aria-expanded="true"] .logo-info-version-toggle i {
  transform: rotate(180deg);
}

.logo-info-version-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--neo-background);
  border: 1px solid var(--neo-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-height: 300px;
  overflow-y: auto;
  z-index: 10;
  display: none;
  margin-top: 4px;
}

.logo-info-version-dropdown[aria-expanded="true"] .logo-info-version-list {
  display: block;
}

.logo-info-version-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--neo-border);
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
}

.logo-info-version-item:last-child {
  border-bottom: none;
}

.logo-info-version-item:hover {
  background: var(--neo-surface);
}

.logo-info-version-item.active {
  background: var(--neo-surface);
  color: var(--neo-primary);
  font-weight: 600;
}

.logo-info-version-item-version {
  font-weight: 600;
  font-size: 14px;
}

/* Desktop: ocultar modal */
@media (min-width: 1024px) {
  .logo-info-modal {
    display: none !important;
  }
}
