:root {
      --primary: #1e3a8a;
      --primary-light: #3b82f6;
      --primary-dark: #0f172a;
      --clip: #ff5000;
      --mp: #009ee3;
      --paypal: #003087;
      --bg: #f8fafc;
      --card-bg: #ffffff;
      --text-main: #0f172a;
      --text-muted: #64748b;
      --border: #cbd5e1;
      --border-light: #e2e8f0;
      --success: #16a34a;
      --warning: #d97706;
      --danger: #dc2626;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
    body { background-color: var(--bg); color: var(--text-main); padding: 0 0 32px 0; line-height: 1.5; }
    .container { max-width: 1250px; margin: 0 auto; padding: 0 16px; }

    /* Barra Superior / Navbar con Menú Hamburguesa */
    .top-navbar {
      background: white;
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    }

    .nav-wrapper {
      max-width: 1250px;
      margin: 0 auto;
      padding: 12px 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .brand-group {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .brand-title {
      font-size: 1.25rem;
      font-weight: 800;
      color: #0f172a;
      letter-spacing: -0.5px;
    }

    .current-view-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: #eff6ff;
      color: var(--primary);
      border: 1px solid #bfdbfe;
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 0.8rem;
      font-weight: 700;
    }

    /* Botón Hamburguesa */
    .hamburger-btn {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 12px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 4.5px;
      width: 42px;
      height: 40px;
      transition: all 0.2s ease;
    }

    .hamburger-btn:hover {
      background: #f1f5f9;
      border-color: #94a3b8;
    }

    .hamburger-btn .bar {
      width: 20px;
      height: 2.2px;
      background-color: #1e293b;
      border-radius: 2px;
      transition: all 0.25s ease;
    }

    /* Menú Lateral Drawer / Overlay */
    .nav-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(15, 23, 42, 0.45);
      backdrop-filter: blur(2px);
      z-index: 200;
      opacity: 0;
      visibility: hidden;
      transition: all 0.25s ease;
    }

    .nav-overlay.open {
      opacity: 1;
      visibility: visible;
    }

    .nav-drawer {
      position: fixed;
      top: 0;
      right: -320px;
      width: 300px;
      height: 100vh;
      background: white;
      z-index: 210;
      box-shadow: -4px 0 20px rgba(0,0,0,0.15);
      transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      flex-direction: column;
    }

    .nav-drawer.open {
      right: 0;
    }

    .drawer-header {
      padding: 18px 20px;
      border-bottom: 1px solid var(--border-light);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #f8fafc;
    }

    .drawer-header h3 {
      font-size: 1.05rem;
      font-weight: 800;
      color: #0f172a;
    }

    .drawer-close {
      background: none;
      border: none;
      font-size: 1.25rem;
      cursor: pointer;
      color: #64748b;
      padding: 4px 8px;
      border-radius: 6px;
      line-height: 1;
    }

    .drawer-close:hover {
      background: #e2e8f0;
      color: #0f172a;
    }

    .drawer-menu {
      list-style: none;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      flex-grow: 1;
    }

    .drawer-item {
      width: 100%;
      background: transparent;
      border: 1px solid transparent;
      padding: 12px 16px;
      border-radius: 10px;
      font-size: 0.96rem;
      font-weight: 700;
      color: #334155;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 12px;
      transition: all 0.2s ease;
      text-align: left;
    }

    .drawer-item:hover {
      background: #f1f5f9;
      color: var(--primary);
    }

    .drawer-item.active {
      background: var(--primary);
      color: white;
      box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
    }

    .drawer-item .icon {
      font-size: 1.2rem;
    }

    .drawer-footer {
      padding: 16px 20px;
      border-top: 1px solid var(--border-light);
      font-size: 0.8rem;
      color: var(--text-muted);
      text-align: center;
      background: #f8fafc;
    }

    /* Contenedor Principal de Pestañas */
    .tab-content {
      display: none;
      animation: fadeIn 0.22s ease-in-out;
      margin-top: 24px;
    }

    .tab-content.active {
      display: block;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* Tarjetas y Componentes */
    .card {
      background: var(--card-bg);
      border-radius: 12px;
      padding: 22px;
      border: 1px solid var(--border);
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
      margin-bottom: 22px;
    }

    .section-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 14px;
      flex-wrap: wrap;
      gap: 12px;
    }

    .section-title {
      font-size: 1.22rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 8px;
      color: #0f172a;
    }

    .input-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 16px;
      align-items: flex-end;
    }

    label { font-size: 0.85rem; font-weight: 600; color: #334155; display: block; margin-bottom: 5px; }

    .input-wrapper {
      position: relative;
      display: flex;
      align-items: center;
    }

    .input-prefix {
      position: absolute;
      left: 12px;
      font-weight: 600;
      color: var(--text-muted);
    }

    input[type="number"], select {
      width: 100%;
      padding: 9px 12px;
      border-radius: 8px;
      border: 1px solid #cbd5e1;
      font-size: 0.95rem;
      color: #0f172a;
      background: #fff;
      outline: none;
    }

    input[type="number"].has-prefix { padding-left: 28px; }
    input:focus, select:focus { border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }

    button.btn {
      border: none;
      padding: 9px 18px;
      border-radius: 8px;
      font-weight: 600;
      font-size: 0.88rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s;
    }

    .btn-primary { background: var(--primary); color: white; }
    .btn-primary:hover { background: #1e40af; }
    .btn-secondary { background: #e2e8f0; color: #334155; }
    .btn-secondary:hover { background: #cbd5e1; }
    .btn-outline { background: white; border: 1px solid var(--border); color: #334155; }
    .btn-outline:hover { background: #f1f5f9; }

    /* Tarjeta Destacada de Calculadora */
    .hero-card {
      background: #ffffff;
      border-radius: 12px;
      border: 1px solid var(--border);
      border-top: 5px solid var(--primary);
      padding: 24px;
      box-shadow: 0 10px 18px -3px rgba(0, 0, 0, 0.05);
      position: relative;
    }

    .price-spotlight {
      background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
      border: 2px solid #86efac;
      border-radius: 12px;
      padding: 22px;
      text-align: center;
      margin: 14px 0;
    }

    .price-spotlight .title-tag {
      font-size: 0.85rem;
      font-weight: 800;
      color: #166534;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }

    .price-spotlight .huge-price {
      font-size: 2.35rem;
      font-weight: 900;
      color: #14532d;
      margin: 6px 0;
    }

    .price-spotlight .diff-tag {
      font-size: 0.95rem;
      color: #15803d;
      font-weight: 700;
    }

    .stat-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      font-size: 0.9rem;
      border-bottom: 1px dashed #e2e8f0;
    }

    .stat-row:last-child { border-bottom: none; }

    .highlight-net { font-weight: 700; color: var(--success); }
    .cost-fee { color: var(--danger); font-weight: 600; }

    /* Bloque Comparativo de Neto Recibido por Plataforma */
    .platform-net-comparison {
      margin-top: 20px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      padding: 16px 18px;
    }

    .platform-net-header {
      font-size: 0.9rem;
      font-weight: 700;
      color: #1e293b;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .platform-net-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 12px;
    }

    .platform-net-card {
      background: white;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      padding: 12px 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .platform-net-card.p-clip { border-left: 4px solid var(--clip); }
    .platform-net-card.p-mp { border-left: 4px solid var(--mp); }
    .platform-net-card.p-paypal { border-left: 4px solid var(--paypal); }

    .platform-net-name {
      font-weight: 700;
      font-size: 0.88rem;
      color: #0f172a;
    }

    .platform-net-fee {
      font-size: 0.76rem;
      color: #64748b;
    }

    .platform-net-val {
      text-align: right;
    }

    .platform-net-val .amount {
      font-size: 1.05rem;
      font-weight: 800;
      color: var(--success);
    }

    /* Tarjetas de Absorción Master */
    .master-sim-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
      gap: 16px;
      margin-top: 14px;
      margin-bottom: 22px;
    }

    .master-sim-card {
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 18px;
      background: white;
    }

    .master-sim-card.p-clip { border-top: 4px solid var(--clip); }
    .master-sim-card.p-mp { border-top: 4px solid var(--mp); }
    .master-sim-card.p-paypal { border-top: 4px solid var(--paypal); }

    /* Tablas */
    .table-container {
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 10px;
      margin-top: 14px;
      background: white;
    }

    table { width: 100%; border-collapse: collapse; font-size: 0.88rem; text-align: right; }
    th, td { padding: 11px 13px; border-bottom: 1px solid var(--border); }
    th { background-color: #f1f5f9; color: #334155; font-weight: 600; }
    th:first-child, td:first-child { text-align: left; font-weight: 600; }
    tr:hover { background-color: #f8fafc; }

    .th-clip { border-top: 4px solid var(--clip); }
    .th-mp { border-top: 4px solid var(--mp); }
    .th-paypal { border-top: 4px solid var(--paypal); }

    /* Estilos Pestaña Comisiones */
    .rates-comparison-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
      gap: 20px;
      margin-top: 16px;
    }

    .rates-box {
      border-radius: 10px;
      border: 1px solid var(--border);
      padding: 18px;
      background: white;
    }

    .rate-field {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 7px;
      font-size: 0.85rem;
    }

    .rate-field input {
      width: 95px;
      padding: 5px 8px;
      text-align: right;
      font-size: 0.88rem;
    }

    .rate-field span.readonly-val {
      font-weight: 700;
      color: #334155;
      background: #e2e8f0;
      padding: 3px 8px;
      border-radius: 4px;
      min-width: 75px;
      text-align: right;
      display: inline-block;
    }

    .tag-saved {
      display: inline-block;
      font-size: 0.78rem;
      padding: 4px 10px;
      border-radius: 4px;
      background: #dcfce7;
      color: #166534;
      font-weight: 700;
    }

    .tag-unsaved {
      display: inline-block;
      font-size: 0.78rem;
      padding: 4px 10px;
      border-radius: 4px;
      background: #fef3c7;
      color: #b45309;
      font-weight: 700;
    }

    .badge-readonly {
      font-size: 0.72rem;
      background: #64748b;
      color: white;
      padding: 2px 7px;
      border-radius: 4px;
      font-weight: 700;
    }

    .badge-master {
      font-size: 0.72rem;
      background: var(--primary);
      color: white;
      padding: 2px 7px;
      border-radius: 4px;
      font-weight: 700;
    }
  
    
    
    .btn-update {
      background: var(--primary);
      color: white;
      border: none;
      padding: 10px 22px;
      border-radius: 8px;
      font-weight: 700;
      font-size: 0.95rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      box-shadow: 0 3px 8px rgba(30, 58, 138, 0.2);
      transition: all 0.2s ease;
    }

    .btn-update:hover {
      background: #1e40af;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
    }

    .btn-update:active {
      transform: translateY(0);
    }

    /* Subnavegación dentro de Calculadoras */
    .calc-subnav {
      display: flex;
      gap: 12px;
      margin-bottom: 22px;
      flex-wrap: wrap;
    }

    .subnav-btn {
      flex: 1;
      min-width: 280px;
      background: #ffffff;
      border: 2px solid #cbd5e1;
      border-radius: 12px;
      padding: 13px 20px;
      font-size: 0.98rem;
      font-weight: 700;
      color: #334155;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      transition: all 0.22s ease-in-out;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
      outline: none;
    }

    .subnav-btn:hover {
      background: #f8fafc;
      border-color: #94a3b8;
      transform: translateY(-1px);
    }

    .subnav-btn.active {
      background: var(--primary) !important;
      color: #ffffff !important;
      border-color: var(--primary) !important;
      box-shadow: 0 4px 14px rgba(30, 58, 138, 0.25) !important;
    }

    .subnav-btn .icon {
      font-size: 1.2rem;
    }

    /* Tarjetas de Selección Opción A y Opción B */
    .mode-selector-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 14px;
      margin-bottom: 20px;
    }

    .mode-card {
      background: #ffffff;
      border: 2px solid #cbd5e1;
      border-radius: 12px;
      padding: 16px 18px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 14px;
      text-align: left;
      position: relative;
      transition: all 0.22s ease-in-out;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
      width: 100%;
      outline: none;
    }

    .mode-card:hover {
      border-color: #94a3b8;
      background: #f8fafc;
      transform: translateY(-1px);
    }

    .mode-card-radio {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .radio-circle {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      border: 2px solid #94a3b8;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
    }

    .radio-circle::after {
      content: '';
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: transparent;
      transition: all 0.2s ease;
    }

    .mode-card-content {
      flex-grow: 1;
    }

    .mode-card-title {
      font-size: 1rem;
      font-weight: 800;
      color: #1e293b;
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 3px;
    }

    .mode-card-title .icon {
      font-size: 1.2rem;
    }

    .mode-card-desc {
      font-size: 0.82rem;
      color: #64748b;
      line-height: 1.35;
    }

    .mode-card-badge {
      display: none;
      font-size: 0.72rem;
      font-weight: 800;
      padding: 4px 10px;
      border-radius: 20px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      flex-shrink: 0;
    }

    /* ESTADO ACTIVO - OPCIÓN A (VERDE / EFECTIVO) */
    .mode-card#btnModeA.active {
      background: #f0fdf4 !important;
      border: 2.5px solid #16a34a !important;
      box-shadow: 0 6px 18px rgba(22, 163, 74, 0.22) !important;
    }

    .mode-card#btnModeA.active .radio-circle {
      border-color: #16a34a !important;
    }

    .mode-card#btnModeA.active .radio-circle::after {
      background: #16a34a !important;
    }

    .mode-card#btnModeA.active .mode-card-title {
      color: #15803d !important;
    }

    .mode-card#btnModeA.active .mode-card-badge {
      display: inline-block !important;
      background: #dcfce7 !important;
      color: #166534 !important;
      border: 1px solid #86efac !important;
    }

    /* ESTADO ACTIVO - OPCIÓN B (AZUL / MSI) */
    .mode-card#btnModeB.active {
      background: #eff6ff !important;
      border: 2.5px solid #1e3a8a !important;
      box-shadow: 0 6px 18px rgba(30, 58, 138, 0.22) !important;
    }

    .mode-card#btnModeB.active .radio-circle {
      border-color: #1e3a8a !important;
    }

    .mode-card#btnModeB.active .radio-circle::after {
      background: #1e3a8a !important;
    }

    .mode-card#btnModeB.active .mode-card-title {
      color: #1e3a8a !important;
    }

    .mode-card#btnModeB.active .mode-card-badge {
      display: inline-block !important;
      background: #dbeafe !important;
      color: #1e40af !important;
      border: 1px solid #93c5fd !important;
    }