/* Creators Access — affiliate (.aff-*)
   Absorbé depuis Admin Access/styles/dashboard/creator-upload.css
   Tokens : shell.css */

/* ── Shared affiliate UI (creator portal + admin) ── */
.cu-section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cu-section-body--flush { padding: 0; }

.aff-wrap { width: 100%; }
.aff-num-bold {
  font-family: "Satoshi", "Satoshi-Regular", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.aff-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.aff-stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 20px;
}
.aff-stat-label {
  font-size: 11px;
  color: var(--cu-muted);
  font-weight: 500;
  letter-spacing: 0.2px;
  margin-bottom: 6px;
}
.aff-stat-value {
  font-size: 24px;
  color: var(--text-primary);
}
.aff-stat-value--pending { color: #f59e0b; }
.aff-stat-value--approved { color: #6366f1; }
.aff-stat-value--paid { color: #22c55e; }
.aff-section { margin-bottom: 28px; }
.aff-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
}
.aff-code {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.aff-code-group { display: flex; align-items: center; gap: 10px; }
.aff-copy-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--cu-surface);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  transform: none;
  box-shadow: none;
}
.aff-copy-btn:hover {
  background: var(--cu-nav-hover);
  border-color: var(--border-color-dark);
  transform: none;
  box-shadow: none;
}
.aff-copy-btn.copied { color: #22c55e; border-color: rgba(34, 197, 94, 0.45); }
.aff-copy-btn svg { width: 16px; height: 16px; }
.aff-code-value {
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}
.aff-code-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.aff-code-meta { font-size: 12px; color: var(--cu-muted); }
.aff-code-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}
[data-theme="dark"] .aff-code-badge {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}
.aff-hint {
  font-size: 12px;
  color: var(--cu-muted);
  margin: 10px 0 0;
  line-height: 1.5;
}
.aff-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
}
.cu-section .aff-table-wrap {
  border: none;
  border-radius: 0;
  background: transparent;
}
.aff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
  min-width: 960px;
}
.aff-table th,
.aff-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-primary);
}
.aff-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--cu-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--bg-tertiary);
  white-space: nowrap;
}
.aff-table tbody tr:last-child td { border-bottom: none; }
.aff-table tbody tr:hover td { background: var(--cu-nav-hover); }
.aff-col-sub { min-width: 140px; text-align: left; }
.aff-col-month { min-width: 72px; text-align: center; white-space: nowrap; }
.aff-col-money { min-width: 88px; text-align: right; white-space: nowrap; }
.aff-col-money--strong { color: var(--text-primary); }
.aff-col-status { min-width: 100px; text-align: center; }
.aff-col-date { min-width: 96px; text-align: right; color: var(--cu-muted); font-size: 12px; white-space: nowrap; }
.aff-col-actions { min-width: 168px; text-align: right; white-space: nowrap; }
.aff-col-muted { color: var(--cu-muted); font-size: 12px; }
.aff-col-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.aff-col-codes {
  min-width: 120px;
  white-space: normal;
}
.aff-sub-id {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  color: var(--cu-muted);
}
.aff-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.aff-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--cu-muted);
}
.aff-apply-box { width: 100%; max-width: 560px; padding: 32px 0; }
.aff-apply-desc {
  color: var(--cu-muted);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.6;
}
.aff-apply-btn {
  padding: 12px 24px;
  background: var(--cu-ink-fill);
  color: var(--cu-ink-on-fill);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transform: none;
  box-shadow: none;
}
.aff-apply-btn:hover { transform: none; box-shadow: none; opacity: 0.92; }
.aff-apply-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.aff-wrap .section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.aff-loading {
  text-align: center;
  padding: 40px;
  color: var(--cu-muted);
}

.aff-loading .ca-spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--text-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: aff-spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes aff-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .aff-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .aff-stats { grid-template-columns: 1fr; }
}
