/* =============================================================
   Sunnah Shopping — Affiliate Program Styles
   Design tokens: --forest #0B3D2E / --gold #C9A84C / --cream #F5F2ED
   ============================================================= */

:root {
  --aff-forest:   #0B3D2E;
  --aff-leaf:     #1A6645;
  --aff-sage:     #4A8C6A;
  --aff-mist:     #EAF2EC;
  --aff-cream:    #F5F2ED;
  --aff-gold:     #C9A84C;
  --aff-gold-lt:  #F0DFA0;
  --aff-ink:      #1C1C1E;
  --aff-mid:      #3A3A3C;
  --aff-dust:     #8A8A8E;
  --aff-r:        .875rem;
  --aff-sh:       0 2px 16px rgba(11,61,46,.08);
}

/* ── Layout ──────────────────────────────────────────────── */

.aff-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  font-family: 'DM Sans', sans-serif;
}

.aff-hero {
  background: linear-gradient(135deg, var(--aff-forest) 0%, var(--aff-leaf) 100%);
  border-radius: 20px;
  padding: 40px 28px;
  color: #fff;
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.aff-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.aff-hero__moon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

.aff-hero__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
}

.aff-hero__subtitle {
  font-size: .925rem;
  opacity: .85;
  margin: 0 0 24px;
}

.aff-hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  padding: 8px 20px;
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── Stat Cards ──────────────────────────────────────────── */

.aff-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .aff-stats { grid-template-columns: repeat(4, 1fr); }
}

.aff-stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--aff-sh);
  border: 1px solid rgba(11,61,46,.07);
  text-align: center;
}

.aff-stat-card__icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.aff-stat-card__value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--aff-forest);
  line-height: 1;
  margin-bottom: 4px;
}

.aff-stat-card__label {
  font-size: .72rem;
  color: var(--aff-dust);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Cards ───────────────────────────────────────────────── */

.aff-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--aff-sh);
  border: 1px solid rgba(11,61,46,.07);
  margin-bottom: 16px;
}

.aff-card__title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--aff-dust);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Referral Link Box ───────────────────────────────────── */

.aff-link-box {
  background: var(--aff-mist);
  border: 1.5px dashed var(--aff-sage);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.aff-link-box__url {
  flex: 1;
  font-size: .8rem;
  color: var(--aff-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
}

/* ── Buttons ─────────────────────────────────────────────── */

.aff-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
}

.aff-btn:active { transform: scale(.97); }

.aff-btn--primary {
  background: var(--aff-forest);
  color: #fff;
}

.aff-btn--primary:hover {
  background: var(--aff-leaf);
  color: #fff;
}

.aff-btn--gold {
  background: var(--aff-gold);
  color: var(--aff-forest);
}

.aff-btn--wa {
  background: #25D366;
  color: #fff;
}

.aff-btn--outline {
  background: transparent;
  border: 1.5px solid var(--aff-forest);
  color: var(--aff-forest);
}

.aff-btn--sm {
  padding: 7px 14px;
  font-size: .78rem;
}

.aff-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Form ────────────────────────────────────────────────── */

.aff-form-group {
  margin-bottom: 16px;
}

.aff-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--aff-mid);
  margin-bottom: 6px;
}

.aff-input,
.aff-textarea,
.aff-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--aff-ink);
  background: #fff;
  transition: border-color .2s;
  box-sizing: border-box;
}

.aff-input:focus,
.aff-textarea:focus,
.aff-select:focus {
  outline: none;
  border-color: var(--aff-sage);
  box-shadow: 0 0 0 3px rgba(74,140,106,.12);
}

.aff-textarea { resize: vertical; min-height: 90px; }

/* ── Status Badge ────────────────────────────────────────── */

.aff-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
}

.aff-badge--pending  { background: #fef3c7; color: #92400e; }
.aff-badge--approved { background: var(--aff-mist); color: var(--aff-forest); }
.aff-badge--paid     { background: #d1fae5; color: #065f46; }
.aff-badge--rejected { background: #fee2e2; color: #991b1b; }

/* ── Assets Grid ─────────────────────────────────────────── */

.aff-assets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 560px) {
  .aff-assets-grid { grid-template-columns: repeat(3, 1fr); }
}

.aff-asset-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(11,61,46,.09);
  background: #fff;
  box-shadow: var(--aff-sh);
}

.aff-asset-item__thumb {
  aspect-ratio: 1;
  object-fit: cover;
  width: 100%;
  display: block;
}

.aff-asset-item__info {
  padding: 10px 12px;
}

.aff-asset-item__name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--aff-ink);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Orders Table ────────────────────────────────────────── */

.aff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}

.aff-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--aff-dust);
  border-bottom: 2px solid var(--aff-mist);
}

.aff-table td {
  padding: 12px;
  border-bottom: 1px solid var(--aff-mist);
  color: var(--aff-mid);
}

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

/* ── Category Chips ──────────────────────────────────────── */

.aff-cat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.aff-chip {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 500;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: all .2s;
  background: #fff;
  color: var(--aff-mid);
}

.aff-chip--active,
.aff-chip:hover {
  background: var(--aff-forest);
  border-color: var(--aff-forest);
  color: #fff;
}

/* ── Alert ───────────────────────────────────────────────── */

.aff-alert {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: .875rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 4px solid;
}

.aff-alert--info    { background: #eff6ff; border-color: #3b82f6; color: #1d4ed8; }
.aff-alert--success { background: var(--aff-mist); border-color: var(--aff-leaf); color: var(--aff-forest); }
.aff-alert--warning { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.aff-alert--error   { background: #fee2e2; border-color: #ef4444; color: #991b1b; }

/* ── Progress Bar ────────────────────────────────────────── */

.aff-progress {
  background: var(--aff-mist);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
  margin: 8px 0;
}

.aff-progress__bar {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--aff-leaf), var(--aff-gold));
  transition: width .6s ease;
}

/* ── Copy Feedback ───────────────────────────────────────── */

.aff-copied {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--aff-forest);
  color: #fff;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: .83rem;
  font-weight: 600;
  opacity: 0;
  transition: all .25s;
  pointer-events: none;
  z-index: 9999;
}

.aff-copied.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Payout Balance ──────────────────────────────────────── */

.aff-balance-box {
  background: linear-gradient(135deg, var(--aff-forest), var(--aff-leaf));
  border-radius: 16px;
  padding: 24px 20px;
  color: #fff;
  text-align: center;
  margin-bottom: 20px;
}

.aff-balance-box__amount {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: 'Cormorant Garamond', serif;
  line-height: 1;
}

.aff-balance-box__label {
  font-size: .8rem;
  opacity: .75;
  margin-top: 4px;
}

.aff-balance-box__note {
  font-size: .78rem;
  opacity: .65;
  margin-top: 12px;
}

/* ── Loading Skeleton ────────────────────────────────────── */

.aff-skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: aff-shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes aff-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 480px) {
  .aff-hero__title  { font-size: 1.6rem; }
  .aff-btn          { padding: 9px 14px; font-size: .82rem; }
  .aff-stat-card__value { font-size: 1.15rem; }
}
