/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Dark Mode Palette (Default) */
  --bg-color: #080c14;
  --panel-bg: rgba(13, 20, 35, 0.75);
  --panel-border: rgba(255, 255, 255, 0.06);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --input-bg: rgba(7, 10, 18, 0.85);
  --input-border: rgba(255, 255, 255, 0.1);
  
  /* Valores del Tema por Defecto: ComisiCal Tricolor (Combinación Logo) */
  --accent-color: #8b5cf6;
  --accent-color-rgb: 139, 92, 246;
  --accent-hover: #7c3aed;
  --theme-gradient: linear-gradient(135deg, #0070ba 0%, #8b5cf6 50%, #e30613 100%);
  --theme-shadow-color: rgba(139, 92, 246, 0.35);
  
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  --table-header-bg: rgba(255, 255, 255, 0.03);
  --table-row-hover: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   TEMAS DE APARIENCIA DEL SISTEMA
   ========================================================================== */
body.theme-comisical {
  --accent-color: #8b5cf6;
  --accent-color-rgb: 139, 92, 246;
  --accent-hover: #7c3aed;
  --theme-gradient: linear-gradient(135deg, #0070ba 0%, #8b5cf6 50%, #e30613 100%);
  --theme-shadow-color: rgba(139, 92, 246, 0.35);
}

body.theme-tricolor_glow {
  --accent-color: #8b5cf6;
  --accent-color-rgb: 139, 92, 246;
  --accent-hover: #0070ba;
  --theme-gradient: linear-gradient(135deg, #0070ba 0%, #8b5cf6 50%, #e30613 100%);
  --theme-shadow-color: rgba(139, 92, 246, 0.4);
}

/* Efectos visuales avanzados para Tricolor Glow Premium */
body.theme-tricolor_glow {
  background: radial-gradient(circle at 10% 10%, rgba(0, 112, 186, 0.12) 0%, transparent 40%),
              radial-gradient(circle at 90% 90%, rgba(227, 6, 19, 0.08) 0%, transparent 40%),
              #080c14;
}

body.theme-tricolor_glow.light-theme {
  background: radial-gradient(circle at 10% 10%, rgba(0, 112, 186, 0.06) 0%, transparent 40%),
              radial-gradient(circle at 90% 90%, rgba(227, 6, 19, 0.04) 0%, transparent 40%),
              #f9fafb;
}

body.theme-tricolor_glow .card {
  border: 1.5px solid rgba(139, 92, 246, 0.16) !important;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.35), 0 0 35px rgba(139, 92, 246, 0.06) !important;
}

body.theme-tricolor_glow.light-theme .card {
  border: 1.5px solid rgba(139, 92, 246, 0.12) !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.02), 0 0 30px rgba(139, 92, 246, 0.04) !important;
}

body.theme-tricolor_glow .top-bar {
  border: 1.5px solid rgba(139, 92, 246, 0.28) !important;
  box-shadow: 0 15px 35px rgba(0, 112, 186, 0.15), 0 5px 15px rgba(227, 6, 19, 0.1), 0 0 25px rgba(139, 92, 246, 0.15) !important;
}

body.theme-tricolor_glow.light-theme .top-bar {
  border: 1.5px solid rgba(139, 92, 246, 0.18) !important;
  box-shadow: 0 15px 35px rgba(0, 112, 186, 0.06), 0 5px 15px rgba(227, 6, 19, 0.04), 0 0 20px rgba(139, 92, 246, 0.06) !important;
}

body.theme-tricolor_glow input:focus, 
body.theme-tricolor_glow select:focus, 
body.theme-tricolor_glow textarea:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(0, 112, 186, 0.25), 0 0 12px rgba(227, 6, 19, 0.2) !important;
}

body.theme-tricolor_glow .gateway-card.active {
  border: 2px solid transparent !important;
  background-image: linear-gradient(var(--panel-bg), var(--panel-bg)), var(--theme-gradient) !important;
  background-origin: border-box !important;
  background-clip: padding-box, border-box !important;
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.25), 0 0 15px rgba(139, 92, 246, 0.1) !important;
}

body.theme-paypal_blue {
  --accent-color: #0070ba;
  --accent-color-rgb: 0, 112, 186;
  --accent-hover: #005ea6;
  --theme-gradient: linear-gradient(135deg, #0070ba 0%, #005ea6 100%);
  --theme-shadow-color: rgba(0, 112, 186, 0.35);
}

body.theme-izipay_red {
  --accent-color: #e30613;
  --accent-color-rgb: 227, 6, 19;
  --accent-hover: #b8050f;
  --theme-gradient: linear-gradient(135deg, #e30613 0%, #ff4b55 100%);
  --theme-shadow-color: rgba(227, 6, 19, 0.35);
}

body.theme-stripe_purple {
  --accent-color: #635bff;
  --accent-color-rgb: 99, 91, 255;
  --accent-hover: #4f46e5;
  --theme-gradient: linear-gradient(135deg, #635bff 0%, #8b5cf6 100%);
  --theme-shadow-color: rgba(99, 91, 255, 0.35);
}

body.theme-kambista_green {
  --accent-color: #00b85a;
  --accent-color-rgb: 0, 184, 90;
  --accent-hover: #009649;
  --theme-gradient: linear-gradient(135deg, #00b85a 0%, #10b981 100%);
  --theme-shadow-color: rgba(0, 184, 90, 0.35);
}

/* Light Mode Override */
body.light-theme {
  --bg-color: #f4f6fa;
  --panel-bg: rgba(255, 255, 255, 0.85);
  --panel-border: rgba(0, 0, 0, 0.06);
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, 0.12);
  --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.08);
  --table-header-bg: rgba(0, 0, 0, 0.03);
  --table-row-hover: rgba(0, 0, 0, 0.01);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(227, 6, 19, 0.08) 0px, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Navbar de Herramientas y Tema */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin-bottom: 2.5rem;
  padding: 1.15rem 2.25rem;
  background: linear-gradient(135deg, rgba(20, 16, 35, 0.85) 0%, rgba(12, 10, 22, 0.92) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(139, 92, 246, 0.22);
  border-radius: 24px;
  box-shadow: 0 15px 35px rgba(139, 92, 246, 0.14), 0 5px 15px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 1rem;
  z-index: 1000;
  animation: fadeInDown 0.6s ease-out;
  transition: all 0.3s ease;
}

body.light-theme .top-bar {
  box-shadow: 0 15px 35px rgba(139, 92, 246, 0.08), 0 5px 15px rgba(0, 0, 0, 0.03);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 243, 255, 0.92) 100%);
  border: 1.5px solid rgba(139, 92, 246, 0.16);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-section h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #0070ba 0%, #8b5cf6 50%, #e30613 100%) !important;
  background-size: 200% auto !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  animation: logoShine 4s linear infinite !important;
}

body.light-theme .brand-section h1 {
  background: linear-gradient(135deg, #0070ba 0%, #8b5cf6 50%, #e30613 100%) !important;
  background-size: 200% auto !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  animation: logoShine 4s linear infinite !important;
}

@keyframes logoShine {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.top-bar-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.theme-toggle-btn, .admin-lock-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.theme-toggle-btn:hover, .admin-lock-btn:hover {
  transform: scale(1.05);
  border-color: rgba(255,255,255,0.2);
}

.admin-lock-btn.logged-in {
  color: var(--success-color);
  border-color: rgba(16, 185, 129, 0.3);
}

.nav-tabs-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: center;
  overflow: visible;
  box-sizing: border-box;
  padding: 0 2rem;
  margin-bottom: 2.5rem;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin-bottom 0.4s ease, padding 0.4s ease;
  max-height: 120px;
  opacity: 1;
}

.navigation-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  width: fit-content;
}

body.light-theme .navigation-tabs {
  background: rgba(0, 0, 0, 0.03);
}

.tab-btn {
  padding: 0.6rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.tab-btn.active {
  background: var(--theme-gradient);
  color: #ffffff;
  box-shadow: 0 8px 20px var(--theme-shadow-color);
  border: none;
}

.tab-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Contenedores Principales */
.main-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1200px;
  width: 100%;
  align-items: stretch;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.card {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 2.25rem;
  box-shadow: var(--card-shadow);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Secciones de las Pestañas */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

/* Selector de Pasarela */
.gateway-selector {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  margin-bottom: 2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) transparent;
}

.gateway-selector::-webkit-scrollbar {
  height: 4px;
}

.gateway-selector::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

.gateway-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 115px;
  height: 95px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body.light-theme .gateway-btn {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.gateway-btn svg, .gateway-btn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gateway-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.gateway-btn:hover svg, .gateway-btn:hover img {
  transform: scale(1.1);
}

body.light-theme .gateway-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

.gateway-btn span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  white-space: nowrap;
}

.gateway-btn.active span {
  color: #ffffff;
}

.gateway-btn:hover span {
  color: var(--text-primary);
}

.gateway-btn.active {
  background: var(--accent-color);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(var(--accent-color-rgb), 0.35);
}

/* Fila de tarifas configurables */
.rates-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

body.light-theme .rates-config {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.04);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

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

.input-wrapper input, .input-wrapper select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.input-wrapper input:focus, .input-wrapper select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.2);
}

.input-wrapper .addon {
  position: absolute;
  right: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Calculadora Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
}

.calc-section {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.015);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
}

body.light-theme .calc-section {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.03);
}

.calc-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-color);
  opacity: 0.8;
}

.calc-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.calc-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.calc-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.calc-row input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.calc-row input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.2);
}

.calc-row input.result-field {
  background: rgba(255, 255, 255, 0.03);
  border-style: dashed;
  color: var(--text-primary);
}

body.light-theme .calc-row input.result-field {
  background: rgba(0, 0, 0, 0.02);
}

.calc-row input.result-field-highlight {
  color: var(--success-color);
  font-size: 1.3rem;
}

/* ==========================================================================
   Sección COMPARADOR
   ========================================================================== */
.comparator-header {
  margin-bottom: 1.5rem;
}

.comparator-input-box {
  background: rgba(255, 255, 255, 0.02);
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

body.light-theme .comparator-input-box {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.04);
}

@media (max-width: 576px) {
  .comparator-input-box {
    grid-template-columns: 1fr;
  }
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
}

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

.comparator-table th {
  background: var(--table-header-bg);
  padding: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--panel-border);
}

.comparator-table td {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid var(--panel-border);
  vertical-align: middle;
}

.comparator-table tr:last-child td {
  border-bottom: none;
}

.comparator-table tr:hover td {
  background: var(--table-row-hover);
}

.gateway-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.gateway-badge-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.gateway-badge-icon svg, .gateway-badge-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.text-highlight {
  font-weight: 700;
  color: var(--text-primary);
}

.best-fee {
  color: var(--success-color);
  font-weight: 700;
}

/* ==========================================================================
   Sección ADMINISTRACIÓN (CRUD y CONFIGURACIÓN)
   ========================================================================== */
.admin-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
}

@media (max-width: 992px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.btn-primary {
  padding: 0.85rem 1.5rem;
  background: var(--theme-gradient);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--theme-shadow-color);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--theme-shadow-color);
}

.btn-danger-outline {
  padding: 0.5rem 0.85rem;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--danger-color);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-danger-outline:hover {
  background: var(--danger-color);
  color: white;
  border-color: transparent;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  transition: all 0.2s ease;
}

body.light-theme .admin-item {
  background: rgba(0, 0, 0, 0.01);
}

.admin-item:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-input-wrapper input[type="color"] {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  background: none;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--input-border);
  border-radius: 12px;
}

/* ==========================================================================
   NUEVO: Switch Checkbox Premium y Contenedor de Checkboxes
   ========================================================================== */
.switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  margin-top: 0.5rem;
}

.switch-label-desc {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.switch-label-desc strong {
  font-size: 0.95rem;
}

.switch-label-desc span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

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

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

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

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

input:focus + .slider {
  box-shadow: 0 0 1px var(--success-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Checkbox Grid para Pasarelas con IGV */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  accent-color: var(--accent-color);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ==========================================================================
   NUEVO: Contenedor y Modal de Bloqueo / Autenticación
   ========================================================================== */
.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.auth-lock-icon {
  width: 64px;
  height: 64px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  animation: pulse 2s infinite;
}

.auth-lock-icon svg {
  width: 32px;
  height: 32px;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Historial */
.history-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  width: 100%;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: fadeIn 0.4s ease-out;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body.light-theme .history-item {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.04);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

body.light-theme .history-item:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04);
}

.history-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.history-icon svg, .history-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.history-details {
  display: flex;
  flex-direction: column;
}

.history-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.history-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

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

.history-amount {
  font-weight: 700;
  font-size: 0.95rem;
}

.history-fee {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--danger-color);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.btn-text-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive */
@media (max-width: 992px) {
  .main-container {
    grid-template-columns: 1fr;
  }
}

/* Footer style */
footer {
  margin-top: 4rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  width: 100%;
  border-top: 1px solid var(--panel-border);
  padding: 1.5rem 0;
}

/* ==========================================================================
   NUEVO: Toast Notification Premium
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 300px;
  max-width: 400px;
  background: rgba(13, 20, 35, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  overflow: hidden;
  position: relative;
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

body.light-theme .toast-item {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.1);
}

.toast-item.toast-success {
  border-left: 4px solid var(--success-color);
}

.toast-item.toast-danger {
  border-left: 4px solid var(--danger-color);
}

.toast-item.toast-warning {
  border-left: 4px solid var(--warning-color);
}

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon.success { color: var(--success-color); }
.toast-icon.danger { color: var(--danger-color); }
.toast-icon.warning { color: var(--warning-color); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  color: var(--text-primary);
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.toast-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

body.light-theme .toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  width: 100%;
}

.toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: toastProgress 4s linear forwards;
}

.toast-success .toast-progress-bar { background: var(--success-color); }
.toast-danger .toast-progress-bar { background: var(--danger-color); }
.toast-warning .toast-progress-bar { background: var(--warning-color); }

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

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

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ==========================================================================
   NUEVO: Modal de Confirmación Premium
   ========================================================================== */
.confirm-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.confirm-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.confirm-modal-card {
  max-width: 440px;
  width: 90%;
  background: rgba(13, 20, 35, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.light-theme .confirm-modal-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15);
}

.confirm-modal-backdrop.active .confirm-modal-card {
  transform: translateY(0) scale(1);
}

.confirm-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.confirm-modal-icon.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.confirm-modal-icon.danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

.confirm-modal-icon.info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.confirm-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.confirm-modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

.confirm-modal-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.confirm-modal-btn {
  flex: 1;
  padding: 0.8rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-modal-btn.btn-cancel {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
}

.confirm-modal-btn.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

body.light-theme .confirm-modal-btn.btn-cancel:hover {
  background: rgba(0, 0, 0, 0.05);
}

.confirm-modal-btn.btn-confirm-action {
  border: none;
  color: white;
}

.confirm-modal-btn.btn-confirm-action.danger {
  background: var(--danger-color);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.confirm-modal-btn.btn-confirm-action.danger:hover {
  background: #dc2626;
}

.confirm-modal-btn.btn-confirm-action.warning {
  background: var(--warning-color);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.confirm-modal-btn.btn-confirm-action.warning:hover {
  background: #d97706;
}

.confirm-modal-btn.btn-confirm-action.primary {
  background: var(--accent-color);
  box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.25);
}

.confirm-modal-btn.btn-confirm-action.primary:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
   NUEVO: Modal de Compartir Cálculo
   ========================================================================== */
.share-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.share-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.share-modal-card {
  max-width: 480px;
  width: 90%;
  background: rgba(13, 20, 35, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

body.light-theme .share-modal-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15);
}

.share-modal-backdrop.active .share-modal-card {
  transform: translateY(0) scale(1);
}

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

.share-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.share-modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.share-modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

body.light-theme .share-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.share-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.share-link-box {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  padding: 0.5rem;
  border-radius: 12px;
  align-items: center;
}

body.light-theme .share-link-box {
  background: rgba(0, 0, 0, 0.01);
}

.share-link-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 0.5rem;
  outline: none;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-btn-copy {
  padding: 0.6rem 1rem;
  background: var(--accent-color);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn-copy:hover {
  background: var(--accent-hover);
}

.share-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.share-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  color: white;
  transition: transform 0.2s, opacity 0.2s;
}

.share-social-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.share-social-btn.whatsapp {
  background: #25D366;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
}

.share-social-btn.telegram {
  background: #0088cc;
  box-shadow: 0 4px 10px rgba(0, 136, 204, 0.2);
}

/* Responsive para el Simulador de Retiros */
@media (max-width: 768px) {
  .withdraw-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

/* Responsive para el Comparador Gráfico */
@media (max-width: 992px) {
  .comparator-results-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
}

/* Animación del pulso interactivo para el widget del tipo de cambio */
@keyframes pulseAnimation {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Animación de giro para la recarga del tipo de cambio */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Tarjetas del comparador de tipo de cambio (estilo cuantoestaeldolar.pe) */
.tc-card {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--card-shadow);
}

.tc-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

body.light-theme .tc-card {
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

body.light-theme .tc-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.tc-card-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.tc-card-rates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.tc-rate-box {
  text-align: center;
  padding: 0.6rem 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  min-width: unset;
}

body.light-theme .tc-rate-box {
  background: #f8fafc;
}

.tc-rate-box.active-best {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.04);
}

body.light-theme .tc-rate-box.active-best {
  background: rgba(16, 185, 129, 0.06);
}

.tc-rate-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}

.tc-rate-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.tc-rate-total {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success-color);
  margin-top: 0.15rem;
}

.tc-card-action {
  display: flex;
  align-items: center;
  width: 100%;
}

.tc-btn-action {
  background: var(--theme-gradient);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px var(--theme-shadow-color);
  width: 100%;
  text-align: center;
}

.tc-btn-action:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
  box-shadow: 0 8px 20px var(--theme-shadow-color);
}

/* ==========================================================================
   EFECTOS PREMIUM DE RESPLANDOR Y SHIMMER (REALCE)
   ========================================================================== */

/* Shimmer Reflect en las tarjetas de cotización */
.tc-card {
  position: relative;
  overflow: hidden;
}

.tc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: 0.75s;
  pointer-events: none;
}

.tc-card:hover::before {
  left: 150%;
}

/* Pulso y Brillo en la Mejor Tasa del Comparador */
.tc-rate-box.active-best {
  border-color: var(--success-color) !important;
  background: rgba(16, 185, 129, 0.05) !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
  animation: tcGlowPulse 2.5s infinite alternate;
}

@keyframes tcGlowPulse {
  0% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }
  100% { box-shadow: 0 0 18px rgba(16, 185, 129, 0.35); border-color: rgba(16, 185, 129, 0.8); }
}

/* Tarjeta con Borde de Gradiente de Acento (Efecto Neon) */
.tc-gradient-glow-card {
  position: relative;
  background: var(--panel-bg);
  border-radius: 20px;
  padding: 1.5rem;
  z-index: 1;
  overflow: hidden;
  border: 1px solid transparent !important;
  box-shadow: var(--card-shadow);
}

.tc-gradient-glow-card::after {
  content: '';
  position: absolute;
  top: -1.5px; left: -1.5px; right: -1.5px; bottom: -1.5px;
  background: var(--theme-gradient);
  z-index: -1;
  border-radius: 21px;
  opacity: 0.25;
  transition: opacity 0.3s ease;
}

.tc-gradient-glow-card:hover::after {
  opacity: 0.7;
}

body.light-theme .tc-gradient-glow-card::after {
  opacity: 0.15;
}

body.light-theme .tc-gradient-glow-card:hover::after {
  opacity: 0.45;
}

/* Responsividad para las tarjetas de tipo de cambio */
@media (max-width: 768px) {
  .tc-card {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    padding: 1.25rem;
  }
  .tc-card-identity {
    justify-content: flex-start;
  }
  .tc-card-rates {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .tc-rate-box {
    min-width: unset;
  }
  .tc-btn-action {
    width: 100%;
    text-align: center;
    padding: 0.8rem;
  }
}

@media (max-width: 576px) {
  .tc-best-summary-row {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}

/* ==========================================================================
   MEJORAS ENLACES DE COBRO - VISTA PREVIA Y HISTORIAL
   ========================================================================== */

/* Layout general de dos columnas o grid para la calculadora/generador */
.enlaces-layout-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 992px) {
  .enlaces-layout-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .mobile-preview-section {
    order: -1; /* Mostrar la vista previa móvil arriba en pantallas pequeñas */
  }
}

/* Agrupaciones del formulario */
.form-group-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.form-group-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

/* Smartphone Container */
.smartphone-container {
  width: 320px;
  height: 580px;
  background: #0b0f19;
  border: 12px solid #1f2937;
  border-radius: 40px;
  position: relative;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 
              0 0 0 2px rgba(255, 255, 255, 0.05),
              0 0 25px rgba(139, 92, 246, 0.15);
  overflow: hidden;
  margin: 0 auto;
}

body.light-theme .smartphone-container {
  border-color: #e5e7eb;
  background: #f9fafb;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.15), 
              0 0 0 2px rgba(0, 0, 0, 0.05);
}

.smartphone-notch {
  width: 120px;
  height: 22px;
  background: #1f2937;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 10;
}

body.light-theme .smartphone-notch {
  background: #e5e7eb;
}

.smartphone-notch::after {
  content: '';
  position: absolute;
  width: 45px;
  height: 4px;
  background: #111827;
  border-radius: 4px;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.smartphone-screen {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 2.25rem 1.25rem 1.25rem 1.25rem;
  font-size: 0.8rem;
  color: #f9fafb;
  position: relative;
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.18), transparent 65%),
              radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.1), transparent 60%),
              #0b0f19;
}

body.light-theme .smartphone-screen {
  color: #1f2937;
}

/* Estilos de scrollbar ocultos para simular pantalla pura */
.smartphone-screen::-webkit-scrollbar {
  display: none;
}
.smartphone-screen {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Interior del celular */
.preview-header {
  text-align: center;
  margin-bottom: 1.25rem;
}
.preview-logo {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
body.light-theme .preview-logo {
  color: #111827;
}
.preview-logo span {
  color: var(--accent-color);
}

.preview-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-color) 0%, #4f46e5 100%);
  color: white;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem auto;
  box-shadow: 0 6px 15px rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-merchant-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.light-theme .preview-merchant-name {
  color: #111827;
}

.preview-solicita-text {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  margin-bottom: 1rem;
}

.preview-amount-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.9rem;
  text-align: center;
  margin-bottom: 1.25rem;
  position: relative;
}

body.light-theme .preview-amount-card {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.preview-amount-currency {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-color);
  margin-right: 0.15rem;
}

.preview-amount-val {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: monospace;
}

.preview-details {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.8rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

body.light-theme .preview-details {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

.preview-detail-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.4rem;
  font-size: 0.75rem;
}

body.light-theme .preview-detail-row {
  border-bottom-color: rgba(0, 0, 0, 0.04);
}

.preview-detail-row:last-child {
  border: none;
  padding-bottom: 0;
}

.preview-detail-label {
  color: #9ca3af;
  font-weight: 500;
}

.preview-detail-val {
  color: #fff;
  font-weight: 600;
  text-align: right;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.light-theme .preview-detail-val {
  color: #1f2937;
}

.preview-payment-methods {
  text-align: left;
  margin-bottom: 1rem;
}

.preview-methods-header {
  font-size: 0.7rem;
  font-weight: 800;
  color: #9ca3af;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.25rem;
}

body.light-theme .preview-methods-header {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.preview-methods-body {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.8rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #e5e7eb;
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
}

body.light-theme .preview-methods-body {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
  color: #4b5563;
}

.preview-gateway-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.preview-btn-gateway {
  padding: 0.7rem 1rem;
  border-radius: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: default;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-btn-paypal {
  background: #0070ba;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 112, 186, 0.25);
}

.preview-btn-merchant {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Exito Overlay en Celular */
.preview-success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.94);
  backdrop-filter: blur(8px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  text-align: center;
  animation: fadeIn 0.4s ease forwards;
}

body.light-theme .preview-success-overlay {
  background: rgba(255, 255, 255, 0.96);
}

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

.success-icon-anim {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: #10b981;
  animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleUp {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.preview-success-overlay h4 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #fff;
}

body.light-theme .preview-success-overlay h4 {
  color: #111827;
}

.preview-success-overlay p {
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.4;
}

body.light-theme .preview-success-overlay p {
  color: #6b7280;
}

/* Panel de Enlace Generado */
.generated-link-panel {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.02) 100%);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  padding: 1.25rem;
  margin-top: 1.25rem;
  animation: fadeInUp 0.4s ease;
}

/* Estilos de la tabla de historial */
.link-history-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}

body.light-theme .link-history-card {
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.link-history-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.3);
}

.link-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.link-history-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.link-history-date {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.link-history-amount {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--success-color);
  font-family: monospace;
}

.link-history-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.75rem;
}

body.light-theme .link-history-actions {
  border-top-color: rgba(0, 0, 0, 0.04);
}

.link-history-btn {
  flex: 1;
  padding: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  transition: all 0.2s;
}

body.light-theme .link-history-btn {
  background: #f9fafb;
}

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

body.light-theme .link-history-btn:hover {
  background: #f3f4f6;
}

.link-history-btn.btn-copy-link {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-color);
  border-color: rgba(99, 102, 241, 0.2);
}

.link-history-btn.btn-copy-link:hover {
  background: var(--accent-color);
  color: white;
}

.link-history-btn.btn-load {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border-color: rgba(16, 185, 129, 0.2);
}

.link-history-btn.btn-load:hover {
  background: var(--success-color);
  color: white;
}

.link-history-btn.btn-delete {
  background: rgba(239, 68, 68, 0.05);
  color: var(--danger-color);
  border-color: rgba(239, 68, 68, 0.15);
  flex: 0 0 32px;
  padding: 0;
}

.link-history-btn.btn-delete:hover {
  background: var(--danger-color);
  color: white;
}

/* ==========================================================================
   NAVEGACIÓN RESPONSIVA DESLIZABLE (SCROLL HORIZONTAL)
   ========================================================================== */

@media (max-width: 992px) {
  /* Mostrar los botones de menú hamburguesa */
  #mobile-menu-toggle, #admin-mobile-menu-toggle {
    display: flex !important;
  }

  /* Ocultar botones individuales del header en móviles para que no se amontonen */
  .top-bar-controls .admin-lock-btn {
    display: none !important;
  }

  /* Ocultar barra de pestañas horizontal normal en móviles (ahora van en la hamburguesa) */
  .nav-tabs-container, .mobile-scroll-hint {
    display: none !important;
  }

  .navigation-tabs::-webkit-scrollbar {
    display: none !important; /* Chrome/Safari */
  }

  /* Asegurar que las pestañas no se encojan y sean legibles */
  .tab-btn {
    flex-shrink: 0 !important;
    font-size: 0.8rem !important;
    padding: 0.55rem 0.9rem !important;
  }

  /* Mostrar la indicación de scroll en móviles */
  .mobile-scroll-hint {
    display: flex !important;
    animation: pulseHint 2.5s infinite ease-in-out;
  }

  /* Centrar cabeceras de sección en dispositivos móviles */
  .section-header, .comparator-header {
    text-align: center !important;
  }
}

/* Indicación oculta por defecto en computadoras */
.mobile-scroll-hint {
  display: none;
}

@keyframes pulseHint {
  0%, 100% { opacity: 0.6; transform: scale(0.98); }
  50% { opacity: 0.95; transform: scale(1); }
}

@media (max-width: 992px) {
  .admin-grid-views {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .nav-tabs-container {
    padding: 0 1.5rem !important;
    margin-bottom: 1.5rem !important;
    justify-content: flex-start !important;
  }
}

/* Ticker Bursátil (Marquesina Horizontal) */
.ticker-wrap {
  width: calc(100% - 2rem);
  max-width: 1200px;
  margin: 0 auto 1.5rem auto;
  border-radius: 16px;
  border: 1.5px solid var(--panel-border);
  overflow: hidden;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.85) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: 44px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ticker {
  display: flex;
  width: max-content;
  animation: ticker-animation 45s linear infinite;
}

.ticker:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 2rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  border-right: 1.5px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.ticker-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent-color);
}

.ticker-item .symbol {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  font-size: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ticker-item .price {
  color: var(--text-primary);
  font-weight: 800;
}

.ticker-item .change {
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.78rem;
}

.ticker-item .change-up {
  color: var(--success-color);
}

.ticker-item .change-down {
  color: var(--danger-color);
}

.ticker-item .change-neutral {
  color: var(--text-secondary);
}

@keyframes ticker-animation {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

/* Ajustes para móviles */
@media (max-width: 768px) {
  .ticker-wrap {
    height: 40px;
  }
  .ticker-item {
    padding: 0 1.25rem;
    font-size: 0.76rem;
  }
}

/* ==========================================================================
   MENÚ HAMBURGUESA ANIMADO Y DRAWER OFF-CANVAS (Premium)
   ========================================================================== */

/* Botón Hamburguesa Animado */
.hamburger-btn-modern {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  z-index: 10002;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.hamburger-btn-modern:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent-color);
}

.hamburger-btn-modern span {
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animaciones al activar (transformación en X) */
.hamburger-btn-modern.active span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.hamburger-btn-modern.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-8px);
}

.hamburger-btn-modern.active span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Contenedor del Overlay de la Hamburguesa */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 5, 15, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  display: flex !important;
  justify-content: flex-end;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* El Cajón Deslizante (Drawer) */
.mobile-nav-drawer {
  width: 85%;
  max-width: 360px;
  height: 100%;
  background: linear-gradient(185deg, rgba(15, 11, 25, 0.98) 0%, rgba(9, 7, 16, 0.99) 100%);
  border-left: 1px solid var(--panel-border);
  box-shadow: -10px 0 45px rgba(0, 0, 0, 0.6);
  padding: 2.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.mobile-nav-overlay.active .mobile-nav-drawer {
  transform: translateX(0);
}

/* Cabecera del Drawer */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Enlaces del Drawer */
.drawer-links-scroll {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

/* Scrollbar para el drawer */
.drawer-links-scroll::-webkit-scrollbar {
  width: 4px;
}
.drawer-links-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Estilo del Botón de Enlace Moderno */
.mobile-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  text-align: left;
}

.mobile-nav-btn:hover, .mobile-nav-btn.active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(99, 102, 241, 0.12) 100%) !important;
  border-color: rgba(139, 92, 246, 0.35) !important;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.08);
  transform: translateY(-1px);
}

.mobile-nav-btn svg {
  color: var(--accent-color);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.mobile-nav-btn:hover svg {
  transform: scale(1.1);
}

/* Sección de Pie de Menú (Footer) */
.drawer-footer {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-info-text {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: center;
  opacity: 0.7;
}

@media (max-width: 992px) {
  .hamburger-btn-modern {
    display: flex !important;
  }
}

