/* ==================================================================
   GENIALSTREAM • ESTILOS PREMIUM (OBSIDIAN & AMBER GOLD THEME)
   ================================================================== */

:root {
  --bg-main: #090d16;
  --bg-surface: #101726;
  --bg-card: rgba(18, 26, 43, 0.75);
  --bg-card-hover: rgba(26, 38, 64, 0.85);
  --bg-glass: rgba(16, 23, 38, 0.65);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(245, 158, 11, 0.35);
  --border-active: rgba(245, 158, 11, 0.6);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-gold: #f59e0b;
  --accent-gold-hover: #d97706;
  --accent-gold-glow: rgba(245, 158, 11, 0.2);

  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.2);

  --accent-rose: #f43f5e;
  --accent-rose-glow: rgba(244, 63, 94, 0.2);

  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.2);

  --sidebar-w: 260px;
  --header-h: 70px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.15);
}

/* Reset y Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-main);
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background-color: transparent;
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
  position: relative;
}

/* ==================================================================
   FONDO CON BLUR 10% (fondo.png) ADAPTATIVO MULTIDISPOSITIVO
   ================================================================== */
body::before {
  content: "";
  position: fixed;
  top: -30px;
  left: -30px;
  right: -30px;
  bottom: -30px;
  background-image: url('../fondo.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: blur(10px);
  -webkit-filter: blur(10px);
  transform: scale(1.05) translateZ(0);
  will-change: transform;
  z-index: -2;
  pointer-events: none;
}

/* Capa de contraste y gradiente para garantizar máxima legibilidad */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 13, 22, 0.80) 0%, rgba(9, 13, 22, 0.88) 100%);
  z-index: -1;
  pointer-events: none;
}

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

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
  outline: none;
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* Layout Principal */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-gold), #b45309);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #000;
  box-shadow: 0 4px 15px var(--accent-gold-glow);
}

.sidebar-brand h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-brand h2 span {
  color: var(--accent-gold);
}

.sidebar-brand p {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ==================================================================
   PROTECCIÓN DE ROLES Y ANTI-PARPADEO (FOUC)
   Ocultos estrictamente por defecto antes de resolver autenticación
   ================================================================== */
[data-admin-only] {
  display: none !important;
}

[data-reseller-only] {
  display: none !important;
}

body.role-admin [data-admin-only]:not(.view-section) {
  display: revert !important;
}

body.role-admin a.nav-link[data-admin-only] {
  display: flex !important;
}

body.role-admin .nav-section-title[data-admin-only] {
  display: block !important;
}

body.role-admin .stat-card[data-admin-only] {
  display: flex !important;
}

body.role-admin .mobile-nav-item[data-admin-only] {
  display: flex !important;
}

body.role-reseller [data-reseller-only]:not(.view-section) {
  display: revert !important;
}

body.role-reseller .stat-card[data-reseller-only] {
  display: flex !important;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 0.75rem 0.75rem 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-link:hover i {
  transform: scale(1.1);
  color: var(--accent-gold);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.03));
  border-left: 3px solid var(--accent-gold);
  font-weight: 600;
}

.nav-link.active i {
  color: var(--accent-gold);
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  font-size: 0.7rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.nav-badge.alert {
  background: var(--accent-rose);
  color: #fff;
}

.nav-badge.info {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
}

.sidebar-user {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: #1e293b;
  border: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-gold);
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-info .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info .user-role {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: capitalize;
}

.user-logout-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.user-logout-btn:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

/* Área Principal de Contenido */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Header Superior */
.top-header {
  height: var(--header-h);
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Ticker de Tasas */
.currency-ticker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
  padding: 4px 0;
}

.ticker-pill {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ticker-pill i {
  color: var(--accent-gold);
}

.ticker-pill b {
  color: #fff;
}

/* Selector de Moneda */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.currency-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.currency-pill {
  background: transparent;
  border: none;
  padding: 4px 11px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.currency-pill:hover {
  color: #fff;
}

.currency-pill.active {
  background: var(--accent-gold);
  color: #000;
  box-shadow: 0 2px 8px var(--accent-gold-glow);
}

.install-pwa-btn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
  border: 1px solid var(--border-glow);
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.install-pwa-btn:hover {
  background: var(--accent-gold);
  color: #000;
}

/* Banner Flotante de Instalación PWA */
.pwa-floating-banner {
  position: fixed;
  bottom: 85px;
  right: 25px;
  max-width: 440px;
  background: rgba(16, 23, 38, 0.95);
  border: 1px solid var(--border-glow);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1rem 1.25rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pwa-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-gold), #b45309);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #000;
  flex-shrink: 0;
}

.pwa-banner-text h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.pwa-banner-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.pwa-banner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

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

/* Contenedor de Vistas */
.content-body {
  padding: 1.75rem;
  flex: 1;
}

.view-section {
  display: none !important;
  animation: fadeIn 0.3s ease-out;
}

.view-section.active {
  display: block !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Encabezado de Sección */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.section-title p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #000;
  box-shadow: 0 4px 15px var(--accent-gold-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24, var(--accent-gold));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-gold-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-emerald-glow);
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #34d399, var(--accent-emerald));
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Tarjetas de Estadísticas (KPIs) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-gold);
  opacity: 0.5;
}

.stat-card.emerald::before {
  background: var(--accent-emerald);
}

.stat-card.rose::before {
  background: var(--accent-rose);
}

.stat-card.cyan::before {
  background: var(--accent-cyan);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-card.emerald .stat-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
}

.stat-card.rose .stat-icon {
  background: rgba(244, 63, 94, 0.1);
  color: var(--accent-rose);
}

.stat-card.cyan .stat-icon {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
}

.stat-content {
  flex: 1;
}

.stat-content .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-content .stat-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin: 2px 0;
}

.stat-content .stat-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Grid de Dashboard y Gráficos */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.panel-header h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header h3 i {
  color: var(--accent-gold);
}

/* Tarjetas de Plataformas y Productos */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.platform-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card);
}

.platform-card-img {
  height: 130px;
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: #1e293b;
}

.platform-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-card) 5%, transparent 80%);
}

.platform-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
  z-index: 2;
}

.platform-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.platform-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}

.platform-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.platform-stats-row {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  margin: 0.75rem 0;
  font-size: 0.78rem;
}

.platform-actions {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

/* Badges y Estados */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid var(--border-subtle);
}

.badge-pulse {
  animation: pulseAmber 2s infinite;
}

@keyframes pulseAmber {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
}

/* Switch Toggles */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: var(--radius-full);
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

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

input:checked+.slider:before {
  transform: translateX(16px);
  background-color: #000;
}

/* Tablas Modernas y Responsive */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table-custom {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.table-custom th {
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  text-align: left;
}

.table-custom tbody tr {
  background: rgba(18, 26, 43, 0.4);
  transition: all 0.2s ease;
}

.table-custom tbody tr:hover {
  background: rgba(26, 38, 64, 0.7);
  transform: scale-[1.002];
}

.table-custom td {
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.table-custom td:first-child {
  border-left: 1px solid var(--border-subtle);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.table-custom td:last-child {
  border-right: 1px solid var(--border-subtle);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.cred-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-family: monospace;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
}

.cred-copy-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s;
}

.cred-copy-btn:hover {
  color: var(--accent-gold);
}

/* Modales */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog.modal-lg {
  max-width: 800px;
}

/* ==================================================================
   LOGIN CON FONDO BLUR 10% (fondo.png) & CRISTAL GLASSMORPHISM
   ================================================================== */
#modal-login {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#modal-login::before {
  content: "";
  position: fixed;
  top: -30px;
  left: -30px;
  right: -30px;
  bottom: -30px;
  background-image: url('../fondo.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: blur(10px);
  -webkit-filter: blur(10px);
  transform: scale(1.05) translateZ(0);
  will-change: transform;
  z-index: -2;
  pointer-events: none;
}

#modal-login::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(9, 13, 22, 0.65) 0%, rgba(9, 13, 22, 0.90) 100%);
  z-index: -1;
  pointer-events: none;
}

#modal-login .modal-dialog {
  background: rgba(16, 23, 38, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-lg);
  position: relative;
  z-index: 1;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--accent-rose);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Formularios */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  color: #fff;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Barra de Navegación Móvil */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: rgba(16, 23, 38, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.mobile-nav-item i {
  font-size: 1.2rem;
}

.mobile-nav-item.active {
  color: var(--accent-gold);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  color: #fff;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideLeft 0.3s ease-out;
}

.toast.success i {
  color: var(--accent-emerald);
}

.toast.error i {
  color: var(--accent-rose);
}

.toast.info i {
  color: var(--accent-gold);
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================================================================
   CENTRO DE AYUDA, MANUAL & FAQ (ESTILOS PREMIUM)
   ================================================================== */
.help-hero-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(16, 185, 129, 0.08) 50%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.help-hero-banner::after {
  content: '\f059';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: -15px;
  bottom: -25px;
  font-size: 10rem;
  color: rgba(245, 158, 11, 0.04);
  pointer-events: none;
}

.help-search-container {
  max-width: 600px;
  margin-top: 1.25rem;
  position: relative;
}

.help-search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  background: rgba(16, 23, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.help-search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px var(--accent-gold-glow);
}

.help-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-gold);
  font-size: 1rem;
}

.help-tabs-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.8rem;
}

.help-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.help-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.help-tab-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.08) 100%);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

.help-role-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.help-role-panel.active {
  display: block;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.benefit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.benefit-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.benefit-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.benefit-icon.gold { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); }
.benefit-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.benefit-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.benefit-icon.rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }

.benefit-card h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.benefit-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.help-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 2rem 0 1rem;
  color: var(--text-main);
}

.help-section-title i {
  color: var(--accent-gold);
}

.steps-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.3rem;
  position: relative;
}

.step-num {
  position: absolute;
  top: -12px;
  left: 16px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--accent-gold);
  color: #000;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.step-card h5 {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: var(--text-main);
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s ease;
}

.faq-item:hover {
  border-color: rgba(245, 158, 11, 0.25);
}

.faq-item.active {
  border-color: var(--border-active);
  background: rgba(18, 26, 43, 0.95);
}

.faq-question {
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  user-select: none;
}

.faq-question i.chevron {
  color: var(--accent-gold);
  transition: transform 0.3s ease;
  font-size: 0.85rem;
}

.faq-item.active .faq-question i.chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  padding: 0 1.4rem;
  border-top: 1px solid transparent;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0.9rem 1.4rem 1.2rem;
  border-top-color: var(--border-subtle);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.glossary-card {
  background: rgba(16, 23, 38, 0.5);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
}

.glossary-term {
  display: inline-block;
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 0.88rem;
  margin-bottom: 0.3rem;
}

.glossary-def {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
  }

  .main-wrapper {
    margin-left: 0;
    margin-bottom: 70px;
  }

  .mobile-toggle {
    display: block;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .top-header {
    padding: 0 1rem;
  }

  .content-body {
    padding: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .currency-ticker {
    display: none;
  }

  #modal-login .modal-dialog {
    max-width: 95%;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  #modal-login .modal-dialog {
    padding: 0.25rem;
    border-radius: var(--radius-md);
  }
}