/* ============================================================================
   FLUS - CORE CSS (PULIDO FINAL)
   - Core: componentes globales
   - Theme: variables de color/tema (light/dark)
============================================================================ */

/* ============================================================================
   [01] RESET + BASE
============================================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;

  /* Fondo global según el theme */
  background-color: var(--bg);
  color: var(--text);
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================================================
   [02] CONTENEDOR PRINCIPAL
============================================================================ */
.root.container-global {
  width: 80%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 14px 40px;
}

@media (max-width: 1200px) {
  .root.container-global {
    width: 100%;
  }
}

/* ============================================================================
   [02.1] UTILIDADES GLOBALES
============================================================================ */
.u-flex {
  display: flex;
}
.u-flex-col {
  display: flex;
  flex-direction: column;
}
.u-center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.u-between {
  display: flex;
  justify-content: space-between;
}
.u-end {
  display: flex;
  justify-content: flex-end;
}

.u-gap-6 {
  gap: 6px;
}
.u-gap-10 {
  gap: 10px;
}
.u-gap-14 {
  gap: 14px;
}
.u-gap-20 {
  gap: 20px;
}

.u-mt-10 {
  margin-top: 10px;
}
.u-mt-20 {
  margin-top: 20px;
}
.u-mt-30 {
  margin-top: 30px;
}
.u-mb-10 {
  margin-bottom: 10px;
}
.u-mb-20 {
  margin-bottom: 20px;
}
.u-mb-30 {
  margin-bottom: 30px;
}

/* ============================================================================
   [03] PANEL UNIVERSAL
============================================================================ */
.panel {
  background: var(--panel);
  border-radius: 18px;
  padding: 24px 30px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  margin-bottom: 28px;
}

/* ============================================================================
   [04] TITULOS Y SUBTITULOS
============================================================================ */
.page-header,
.module-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px 20px;
  margin-bottom: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.page-header-main,
.page-header-left,
.module-header-main {
  flex: 1 1 520px;
  min-width: 0;
}

.module-header-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.module-header-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.module-header-copy::after {
  content: "";
  display: block;
  width: 76px;
  height: 2px;
  margin-top: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.78), rgba(14, 165, 233, 0.1));
}

.module-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan, #06b6d4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.module-header-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.page-eyebrow,
.module-eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-header .page-title,
.module-header .page-title {
  margin: 0;
  font-size: clamp(1.34rem, 1.58vw, 1.6rem);
  line-height: 1.06;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.page-header .page-sub,
.module-header .page-sub {
  margin: 6px 0 0;
  font-size: 0.93rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 44ch;
}

.module-subtitle {
  max-width: 44ch;
}

.page-meta,
.module-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.08);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.page-header-actions,
.page-actions,
.header-actions,
.module-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.sub-title {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .page-header,
  .module-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .module-header-hero {
    gap: 12px;
  }

  .module-header-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 12px;
  }

  .page-header-actions,
  .page-actions,
  .header-actions,
  .module-header-actions,
  .page-meta,
  .module-header-meta {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ============================================================================
   [05] NAVBAR MEJORADA (RESPONSIVE + ANIMACIONES + A11Y)
============================================================================ */

.nav-container {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;

  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);

  transition: padding 0.2s ease;
}

/* ============================================================================
   LOGO / MARCA
============================================================================ */
.nav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-right: 18px;
}

.nav-logo {
  font-size: 1.42rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--nav-logo-color, #22d3ee);
  text-shadow: 0 1px 8px rgba(34, 211, 238, 0.18);

  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.nav-brand:hover .nav-logo {
  transform: scale(1.05);
  color: var(--nav-pill-hover-text, #7dd3fc);
}

/* ============================================================================
   HAMBURGUESA (MOBILE)
============================================================================ */
.nav-hamburger {
  display: none; /* Visible solo en mobile */
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  z-index: 1001;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: var(--nav-pill-text);
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.nav-hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================================
   MENÚ WRAPPER
============================================================================ */
.nav-menu-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 20px;
}

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

.nav-group {
  position: relative;
}

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

/* ============================================================================
   PILLS (ENLACES)
============================================================================ */
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;

  border: 1px solid transparent;
  background: transparent;
  color: var(--nav-pill-text);

  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.nav-pill:hover {
  background: var(--nav-pill-hover-bg);
  border-color: color-mix(in srgb, var(--nav-pill-text) 12%, transparent);
  transform: translateY(-1px);
}

.nav-pill:focus-visible {
  outline: 2px solid var(--accent-cyan, #06b6d4);
  outline-offset: 2px;
}

.nav-pill.active {
  background: var(--nav-pill-active-bg);
  color: var(--nav-pill-active-text);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.28);
  font-weight: 700;
}

.nav-pill.active:hover {
  transform: none;
  cursor: default;
}

.nav-group-btn {
  cursor: pointer;
}

.nav-group-btn.active {
  min-width: 0;
}

.nav-caret {
  display: inline-flex;
  align-items: center;
  opacity: 0.55;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s;
  margin-left: -2px;
}

.nav-dropdown.open .nav-caret,
.nav-group.open .nav-caret {
  transform: rotate(180deg);
  opacity: 0.9;
}

.nav-group-menu {
  min-width: 220px;
  left: 0;
  right: auto;
}
/* Bloquear scroll del fondo cuando el menú está abierto */
html.nav-open,
body.nav-open {
  height: 100%;
  overflow: hidden;
}


/* ============================================================================
   BADGE CAJA (ESTADO)
============================================================================ */
.badge-mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;

  border: 1px solid var(--badge-mode-border);
  background: var(--badge-mode-bg);
  color: var(--badge-mode-text);

  transition: all 0.3s ease;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 8px rgba(148, 163, 184, 0.6);

  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}

/* Estado: Caja abierta */
.badge-mode.is-open {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.badge-mode.is-open .badge-dot {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
  animation: pulse-badge 2s ease-in-out infinite;
}

/* Estado: Caja cerrada */
.badge-mode.is-closed {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.badge-mode.is-closed .badge-dot {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

@keyframes pulse-badge {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Ocultar texto en pantallas pequeñas */
@media (max-width: 768px) {
  .badge-text {
    display: none;
  }

  .badge-mode {
    padding: 5px 8px;
  }
}

/* ============================================================================
   THEME TOGGLE
============================================================================ */
.theme-switch {
  position: relative;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 52px;
  padding: 3px 7px;
  border-radius: 999px;

  background: var(--toggle-track-bg);
  border: 1px solid var(--toggle-track-border);
  font-size: 0.75rem;

  transition:
    background 0.3s ease,
    border-color 0.3s ease;
}

.toggle-icon {
  opacity: 0.5;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.theme-switch input:checked + .theme-toggle .toggle-icon--sun {
  opacity: 0.3;
}

.theme-switch input:not(:checked) + .theme-toggle .toggle-icon--moon {
  opacity: 0.3;
}

.theme-switch input:checked + .theme-toggle .toggle-icon--moon {
  opacity: 1;
}

.theme-switch input:not(:checked) + .theme-toggle .toggle-icon--sun {
  opacity: 1;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-switch input:checked + .theme-toggle .toggle-thumb {
  transform: translateX(26px);
}

.theme-toggle:hover .toggle-track {
  border-color: var(--nav-pill-active-bg);
}

/* ============================================================================
   DROPDOWN MENÚ (ADMIN)
============================================================================ */
.nav-dropdown {
  position: relative;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 42px;
  border-radius: 12px;
  font-size: 1.1rem;

  border: 1px solid var(--nav-icon-border);
  background: var(--nav-icon-bg);
  color: var(--nav-icon-text);

  cursor: pointer;
  text-decoration: none;
  user-select: none;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.nav-icon:hover {
  background: var(--nav-icon-hover-bg);
  transform: translateY(-2px);
}

.nav-icon:focus-visible {
  outline: 2px solid var(--nav-pill-active-bg);
  outline-offset: 2px;
}

.nav-icon.active {
  border-color: var(--nav-icon-active-border);
  box-shadow: var(--nav-icon-active-shadow);
}

.nav-dropdown-menu {
  position: absolute;
  right: 0;
  top: 46px;
  min-width: 200px;

  background: var(--panel-bg);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--panel-shadow);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px) scale(0.97);
  transform-origin: top center;
  transition:
    opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.18s;

  z-index: 2000;
}

.nav-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;

  transition: background 0.12s ease;
}

.nav-dropdown-menu a.active {
  background: color-mix(in srgb, var(--accent-cyan, #0ea5e9) 12%, transparent);
  color: var(--accent-cyan, #0ea5e9);
  font-weight: 700;
}

.nav-dropdown-menu a:hover {
  background: var(--nav-pill-hover-bg);
}

.nav-dropdown-menu a.active:hover {
  background: color-mix(in srgb, var(--accent-cyan, #0ea5e9) 18%, transparent);
}

.nav-group-menu a {
  position: relative;
  padding-left: 14px;
}

.nav-group-menu a.active::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: var(--accent-cyan, #0ea5e9);
  transform: translateY(-50%);
}

.nav-dropdown-menu a:focus-visible {
  outline: 2px solid var(--nav-pill-active-bg);
  outline-offset: -2px;
}

.menu-icon {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* ============================================================================
   USUARIO
============================================================================ */
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 12px;
  border-radius: 999px;

  background: var(--nav-pill-bg);
  border: 1px solid var(--nav-pill-border);

  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.nav-username {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--nav-pill-text);
  opacity: 0.9;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;

  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);

  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.logout-btn:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

.logout-icon {
  font-size: 0.9rem;
}

.logout-text {
  font-weight: 600;
}

/* ============================================================================
   RESPONSIVE (MOBILE)
============================================================================ */
@media (max-width: 968px) {
  .nav-hamburger {
    display: flex;
  }

  .nav-menu-wrapper {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;

    flex-direction: column;
    align-items: stretch;
    gap: 0;

    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);

    max-height: 0;
    overflow: hidden;

    opacity: 0;
    visibility: hidden;

    transition:
      max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.3s ease,
      visibility 0.3s ease;
  }

  .nav-menu-wrapper.open {
    max-height: calc(100vh - 60px);
    opacity: 1;
    visibility: visible;
  }

  .nav-left,
  .nav-right {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 12px;
  }

  .nav-left {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 10px;
  }

  .nav-left > * + * {
    margin-top: 8px;
  }

  .nav-pill {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
  }

  .nav-right {
    border-top: 1px solid var(--nav-border);
    margin-top: 2px;
    padding-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
  }

  .nav-user {
    width: 100%;
    justify-content: space-between;
    padding: 10px 12px;
  }

  .badge-mode {
    width: 100%;
    justify-content: center;
  }

  .theme-switch {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border: 1px solid var(--nav-icon-border);
    border-radius: 10px;
    background: var(--nav-icon-bg);
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .nav-icon {
    width: 100%;
    min-width: 44px;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 10px;
  }

  .nav-right > .nav-icon,
  .nav-right > .theme-switch,
  .nav-right > .nav-dropdown {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
  }

  .theme-switch .theme-toggle {
    width: 52px;
    justify-content: center;
  }

  .nav-right > .nav-user-block {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 4px;
  }

  .nav-dropdown-menu {
    position: static;
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    box-shadow: none;
    border: 1px solid transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
    transform-origin: top center;
    min-width: 0;
    transition:
      max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.22s ease,
      visibility 0.22s,
      margin-top 0.22s ease,
      border-color 0.22s ease;
  }

  .nav-group-menu {
    min-width: 0;
    border-radius: 10px;
    padding: 6px;
    background: color-mix(in srgb, var(--panel-bg) 92%, transparent);
  }

  .nav-group-menu a,
  .nav-dropdown-menu a {
    border-radius: 8px;
  }

  .nav-group.open > .nav-group-menu,
  .nav-dropdown.open > .nav-dropdown-menu {
    max-height: 520px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    margin-top: 8px;
    border-color: var(--panel-border);
  }

  .nav-dropdown-menu.open {
    max-height: 520px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    border-color: var(--panel-border);
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 8px 12px;
  }

  .nav-logo {
    font-size: 1.15rem;
  }

  .nav-username {
    display: none;
  }

  .logout-text {
    display: none;
  }

  .logout-btn {
    padding: 6px 10px;
  }
}

/* ============================================================================
   ACCESIBILIDAD
============================================================================ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible mejorado */
*:focus-visible {
  outline: 2px solid var(--nav-pill-active-bg);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content (accesibilidad) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--nav-pill-active-bg);
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

/* ============================================================================
   Logout (USA VARIABLES DEL THEME)
============================================================================ */
.logout-link {
  font-size: 0.82rem;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;

  border: 1px solid var(--logout-border);
  color: var(--logout-text);
  background: transparent;

  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.logout-link:hover {
  background: var(--logout-hover-bg);
  border-color: var(--logout-hover-border);
  color: var(--logout-hover-text);
}

/* ============================================================================
   [06] BOTONES GLOBALES
============================================================================ */
.btn,
.v-btn,
.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;

  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border-color: var(--btn-secondary-border);

  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

/* PRIMARIO */
.v-btn--primary,
.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: transparent;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.55);
}

.v-btn--primary:hover,
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.8);
}

/* SECUNDARIO */
.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border-color: var(--btn-secondary-border);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover-bg);
  border-color: var(--btn-secondary-hover-border);
  color: var(--btn-secondary-hover-text);
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
}

/* PELIGRO */
.btn-danger {
  background: var(--btn-danger-bg);
  color: var(--btn-danger-text);
  border-color: var(--btn-danger-border);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(185, 28, 28, 0.6);
}

/* VARIANTES EXTRA */
.v-btn--outline {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}
.v-btn--outline:hover {
  background: rgba(34, 211, 238, 0.1);
}

.v-btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.v-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.v-btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

/* ============================================================================
   [07] INPUTS / SELECTS / FORMULARIOS
============================================================================ */
input,
select,
textarea {
  background: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  transition: 0.18s border ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

/* Filtros globales */
.filters {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

/* ============================================================================
   [08] TABLAS GLOBALES
============================================================================ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 14px;
  font-size: 0.78rem;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--table-row-border);
}

tbody tr:nth-child(odd) {
  background: var(--table-row-odd);
}
tbody tr:nth-child(even) {
  background: var(--table-row-even);
}

tbody tr:hover {
  background: rgba(34, 211, 238, 0.06);
}

.empty-cell {
  opacity: 0.7;
  text-align: center;
  padding: 18px;
}

/* ============================================================================
   [09] PAGINACIÓN GLOBAL
============================================================================ */
.pager {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
  align-items: center;
}

.pager-btn {
  padding: 8px 14px;
  background: var(--panel);
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  color: var(--text);
  cursor: pointer;
  transition: 0.18s;
}

.pager-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pager-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pager-mid {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* ============================================================================
   [10] TAGS / BADGES
============================================================================ */
.tag {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  display: inline-block;
  color: #fff;
}

.tag-ok {
  background: #3cc878;
}
.tag-bajo {
  background: #e9b83f;
}
.tag-sin {
  background: #e05d5d;
}
.tag-inactivo {
  background: #6f6f6f;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.badge-mode.is-open {
  opacity: 1;
}

.badge-mode.is-closed {
  opacity: 0.8;
  filter: grayscale(0.4);
}

/* ============================================================================
   [11] TARJETAS DE ESTADÍSTICAS
============================================================================ */
.stats-row,
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  transition: 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 4px;
}

/* ============================================================================
   [12] TOAST
============================================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(14px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #fff;
  z-index: 9999;
  transition: 0.2s ease;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
body[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
}

/* ============================================================================
   Version de FLus
============================================================================ */
.flus-version-badge {
  position: fixed;
  right: 12px;
  bottom: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 50;
  opacity: 0.85;
}

.flus-version-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.2px;
}

.flus-version-badge:hover {
  opacity: 1;
}
.flus-version-link:hover {
  color: var(--text-primary);
}
/* ============================================================================
   FIN DEL CORE CSS
============================================================================ */
