/* Afiliados — tema verde TokenFI */
.aff-body { background: transparent; }
.aff-body .phone {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.aff-body .main-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 12px var(--page-pad) calc(76px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}
.aff-body .bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
}
.aff-hero {
  background: var(--bg-card);
  margin: 0;
  padding: 12px 0 14px;
  border-bottom: 1px solid #e8eeea;
  color: var(--text);
  flex-shrink: 0;
}
.aff-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  padding: 0 var(--page-pad);
}
.aff-hero-top__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.aff-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef2ef;
  font-size: 12px;
  font-weight: 800;
}
.aff-rules-btn {
  border: 1px solid #dce5e0;
  background: var(--bg);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.aff-tier-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 var(--page-pad) 6px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.aff-tier-scroll::-webkit-scrollbar { display: none; }
.aff-tier-chip {
  flex: 0 0 auto;
  min-width: 64px;
  text-align: center;
  background: rgba(255,255,255,0.95);
  color: var(--green-dark);
  border-radius: 12px;
  padding: 8px 10px;
}
.aff-tier-chip strong { display: block; font-size: 16px; }
.aff-tier-chip span { font-size: 9px; color: var(--text-secondary); }
.aff-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eef2ef;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 var(--page-pad);
}
.aff-promo strong { font-size: 26px; }
.aff-promo span { font-size: 11px; opacity: 0.95; display: block; }
.aff-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.aff-stat {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.aff-stat label { font-size: 10px; color: var(--text-secondary); display: block; margin-bottom: 4px; }
.aff-stat strong { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.aff-stat-full { grid-column: 1 / -1; }
.aff-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.aff-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.aff-btn-copy { background: var(--green); color: #fff; }
.aff-btn-withdraw { background: var(--bg-card); color: var(--green-dark); box-shadow: var(--shadow-sm); border: 1px solid #dce5e0; }
.aff-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.aff-modal.is-open {
  display: flex;
}
body.aff-modal-open {
  overflow: hidden;
}
.aff-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.aff-modal__sheet {
  position: relative;
  width: 100%;
  max-width: 430px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 18px var(--page-pad) calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}
.aff-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.aff-modal__head h2 { font-size: 18px; margin: 0; }
.aff-modal__close {
  border: none;
  background: #eef2ef;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.aff-modal__avail {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 14px;
}
.aff-modal__avail strong { color: var(--green-dark); font-size: 15px; }
.aff-table-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.aff-table-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.aff-period-tabs { display: flex; gap: 6px; }
.aff-period-tab {
  border: none;
  background: #eef2ef;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.aff-period-tab.active { background: var(--green); color: #fff; }
.aff-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.aff-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 10px; }
.aff-table th, .aff-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid #eef2ef; }
.aff-table th:first-child, .aff-table td:first-child { text-align: left; font-weight: 600; }
.aff-table th { color: var(--text-muted); font-weight: 500; }
.aff-ref-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}
