:root {
  --primary: #1d5fc7;
  --primary-dark: #123f8a;
  --bg-cream: #faf6ee;
  --text-dark: #1a2b4c;
  --border: #e2ddd0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-cream);
  color: var(--text-dark);
}

/* =========================================================
   SPLIT-SCREEN AUTH (LOGIN & REGISTER AFILIATOR)
   ========================================================= */
.aff-split-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.aff-split-brand {
  width: 45%;
  background: var(--primary-dark);
  color: #ffffff;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
}

.aff-brand-content {
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.aff-brand-logo {
  display: inline-block;
  margin-bottom: 2px;
  text-decoration: none;
}

.aff-brand-logo img {
  height: 56px;
  display: block;
}

.aff-brand-caption {
  display: inline-block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #ffffff;
  margin-bottom: 30px;
  text-align: center;
}

.aff-brand-headline {
  margin: 0;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  text-align: justify;
}

.aff-split-form-panel {
  width: 55%;
  min-height: 100vh;
  background: var(--bg-cream);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 36px 32px 24px;
}

.aff-form-center {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.aff-form-card {
  width: 100%;
  max-width: 410px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 34px 32px;
  box-shadow: 0 10px 30px rgba(18, 63, 138, 0.06);
}

.aff-form-title {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
}

.aff-field {
  margin-top: 16px;
}

.aff-field:first-of-type {
  margin-top: 0;
}

.aff-form-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 6px;
}

.aff-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.aff-label-row label {
  margin: 0;
}

.aff-forgot-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.aff-forgot-link:hover {
  text-decoration: underline;
}

.aff-form-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-dark);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aff-form-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 95, 199, 0.1);
}

.aff-password-wrap {
  position: relative;
}

.aff-password-wrap input {
  padding-right: 42px;
}

.aff-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.aff-eye-btn:hover {
  color: var(--primary);
}

.aff-btn-submit {
  width: 100%;
  margin-top: 22px;
  padding: 12px 16px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.aff-btn-submit:hover {
  background: var(--primary-dark);
}

.aff-form-switch {
  margin: 18px 0 0;
  text-align: center;
  font-size: 14px;
  color: #64748b;
}

.aff-form-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.aff-form-switch a:hover {
  text-decoration: underline;
}

.aff-customer-footer {
  margin: 2px 0 0;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.aff-customer-footer a {
  color: #64748b;
  text-decoration: underline;
  font-weight: 500;
}

.aff-customer-footer a:hover {
  color: var(--text-dark);
}

/* =========================================================
   ALERTS
   ========================================================= */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.45;
}

.alert-error {
  background: #fde8e8;
  color: #b02a2a;
}

.alert-success {
  background: #e6f6ec;
  color: #1b7a3d;
}

.alert-info {
  background: #eff6ff;
  color: #1d4ed8;
}

.alert ul {
  margin: 0;
  padding-left: 18px;
}

/* =========================================================
   PORTAL SHELL: TOP NAVBAR, CONTAINER & FOOTER
   ========================================================= */
.aff-portal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-cream);
  color: var(--text-dark);
}

.aff-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 60;
}

.aff-topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.aff-topbar-inner.has-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.aff-topbar-logo {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  text-decoration: none;
}

.aff-topbar-logo img {
  height: 30px;
  display: block;
}

.aff-topbar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.aff-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.aff-topbar-link:hover {
  color: var(--text-dark);
  background: var(--bg-cream);
}

.aff-topbar-link.is-active {
  color: var(--primary-dark);
  background: #eff6ff;
}

.aff-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.aff-user-dropdown {
  position: relative;
  justify-self: end;
}

.aff-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 6px 4px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-dark);
  cursor: pointer;
  transition: color 0.15s ease;
}

.aff-user-chevron {
  transition: color 0.15s ease;
  color: #64748b;
}

.aff-user-trigger:hover .aff-user-chevron,
.aff-user-dropdown.is-open .aff-user-chevron {
  color: var(--primary);
}

.aff-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 28px rgba(18, 63, 138, 0.12);
  display: none;
  z-index: 80;
}

.aff-user-dropdown.is-open .aff-user-menu {
  display: block;
}

.aff-user-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.aff-user-menu a:hover {
  background: var(--bg-cream);
  color: var(--text-dark);
}

.aff-container {
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 56px;
  flex: 1 1 auto;
}

/* =========================================================
   HALAMAN PROFIL & PENGATURAN AKUN
   ========================================================= */
.aff-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.15s ease;
}

.aff-back-link:hover {
  color: var(--primary);
}

.aff-page-head {
  margin-bottom: 8px;
  margin-left: 12px;
}

.aff-page-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  color: var(--primary-dark);

}

.aff-dash-head {
  margin-bottom: 22px;
  margin-left: 8px;
}

.aff-dash-head .aff-page-title {
  font-size: 24px;
}

/* =========================================================
   DASHBOARD AREA ATAS: HERO GRID 3 KARTU
   ========================================================= */
.aff-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.9fr;
  gap: 20px;
  margin-bottom: 28px;
  align-items: stretch;
}

@media (max-width: 960px) {
  .aff-hero-grid {
    grid-template-columns: 1fr;
  }
}

.aff-hero-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 4px 18px rgba(18, 63, 138, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.aff-hero-card>div {
  min-width: 0;
}

.aff-hero-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.aff-hero-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
}

.aff-cutoff-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.aff-hero-amount {
  margin: 22px 0 10px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.aff-hero-progress {
  margin-bottom: 12px;
}

.aff-hero-progress .aff-progress-wrap {
  height: 8px;
  background: #e8eef5;
}

.aff-hero-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: #64748b;
}

.aff-ref-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 10px;
}

.aff-ref-code {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.aff-ref-link-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  line-height: 1.45;
}

.aff-ref-copy-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 7px;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.aff-ref-copy-icon:hover {
  background: var(--primary-dark);
}

.aff-ref-copy-icon.btn-copied {
  background: #0f766e;
}

.aff-pill-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.aff-pill-status--active {
  background: #eff6ff;
  color: var(--primary);
}

.aff-pill-status--pending {
  background: #fef3c7;
  color: #b45309;
}

.aff-pill-status--rejected {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.aff-hero-state-title {
  margin: 18px 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.3;
}

.aff-hero-note {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.aff-hero-bank-box {
  margin-top: 18px;
  background: var(--primary-dark);
  color: #ffffff;
  border-radius: 12px;
  padding: 14px 16px;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.aff-hero-bank-box.is-inactive {
  background: #64748b;
  opacity: 0.92;
}

.aff-hero-bank-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.aff-hero-bank-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.aff-hero-bank-pill {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  padding: 2px 9px;
  border-radius: 999px;
}

.aff-hero-bank-box.is-inactive .aff-hero-bank-pill {
  background: rgba(15, 23, 42, 0.28);
}

.aff-hero-bank-num {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-bottom: 6px;
}

.aff-hero-bank-holder {
  font-size: 12.5px;
  opacity: 0.86;
}

.aff-hero-card-foot {
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

.aff-hero-foot-note {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
}

.aff-hero-foot-note strong {
  color: var(--text-dark);
  font-weight: 600;
}

.aff-hero-foot-note.is-ready {
  color: var(--primary);
  font-weight: 500;
}

.aff-hero-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.aff-hero-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}


.aff-tabs {
  display: inline-flex;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 24px;
}

.aff-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.aff-tab-btn:hover {
  color: var(--text-dark);
  background: var(--bg-cream);
}

.aff-tab-btn.active {
  background: var(--primary-dark);
  color: #ffffff;
}

.aff-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.aff-grid-bank {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}

.aff-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: 0 4px 18px rgba(18, 63, 138, 0.04);
  margin-bottom: 24px;
}

.aff-card-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-dark);
}

.aff-card-desc {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.5;
}

.aff-form-group {
  margin-bottom: 16px;
}

.aff-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 6px;
}

.aff-form-group input,
.aff-form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-dark);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aff-form-group input:focus,
.aff-form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 95, 199, 0.1);
}

.aff-form-group input[readonly] {
  background: #f8f6f0;
  color: #64748b;
  cursor: not-allowed;
}

.aff-help-text {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 5px;
  line-height: 1.45;
}

.aff-req {
  color: #dc2626;
}

.aff-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0 14px;
}

.aff-inline-note {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.aff-inline-note a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.aff-inline-note a:hover {
  text-decoration: underline;
}

.aff-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.aff-btn-primary:hover {
  background: var(--primary-dark);
}

.aff-btn-block {
  width: 100%;
}

/* Bank visual & security */
.aff-bank-visual {
  background: var(--primary-dark);
  color: #ffffff;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 16px;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.aff-bank-visual.is-inactive {
  background: #64748b;
  opacity: 0.9;
}

.aff-bank-visual-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.aff-bank-name {
  font-size: 13px;
  letter-spacing: 1px;
  font-weight: 700;
  opacity: 0.9;
  text-transform: uppercase;
}

.aff-bank-number {
  font-size: 21px;
  letter-spacing: 3px;
  font-family: monospace;
  font-weight: 700;
  margin-bottom: 16px;
}

.aff-bank-visual-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.aff-bank-holder-label {
  font-size: 10.5px;
  text-transform: uppercase;
  opacity: 0.75;
  display: block;
  margin-bottom: 2px;
}

.aff-bank-holder-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.aff-bank-active-pill {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
  padding: 3px 10px;
  border-radius: 999px;
}

.aff-bank-active-pill.is-inactive {
  background: rgba(15, 23, 42, 0.35);
}

.aff-bank-toggle-row {
  margin: 0;
}

.aff-btn-outline {
  width: 100%;
  padding: 10px 16px;
  background: #ffffff;
  color: var(--text-dark);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.aff-btn-outline:hover {
  background: var(--bg-cream);
  border-color: #cbd5e1;
}

.aff-bank-empty {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}

.aff-bank-empty-title {
  margin: 0 0 6px;
  font-weight: 700;
  color: #92400e;
  font-size: 14.5px;
}

.aff-bank-empty-desc {
  margin: 0;
  font-size: 13px;
  color: #b45309;
  line-height: 1.5;
}

.aff-modal-summary {
  background: var(--bg-cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 16px;
}

.aff-modal-summary strong {
  display: block;
  color: var(--text-dark);
}

.aff-security-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 18px 0 20px;
}

.aff-security-box label {
  margin-bottom: 4px;
  color: var(--primary-dark);
}

.aff-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.aff-modal-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
}

/* =========================================================
   KOMPONEN DASHBOARD & MILESTONE
   ========================================================= */
.aff-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.aff-progress-wrap {
  background: #e2e8f0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  width: 100%;
}

.aff-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.5s ease;
}

.aff-progress-bar.is-complete {
  background: #0f766e;
}

.aff-milestone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.aff-milestone-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 18px rgba(18, 63, 138, 0.04);
}

.aff-milestone-card.is-claimable {
  border-color: #93c5fd;
  box-shadow: 0 6px 22px rgba(29, 95, 199, 0.08);
}

/* =========================================================
   DASHBOARD TAHAP 3: RINGKASAN PERFORMA & MILESTONE
   ========================================================= */
.aff-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.aff-perf-section {
  margin-bottom: 24px;
}

.aff-perf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  margin-left: 8px;
}

.aff-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

.aff-period-form {
  margin: 0;
}

.aff-period-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text-dark);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aff-period-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 95, 199, 0.1);
}

.aff-perf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 960px) {
  .aff-perf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.aff-perf-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 4px 18px rgba(18, 63, 138, 0.04);
}

.aff-perf-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 10px;
}

.aff-perf-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.3px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.aff-perf-sub {
  margin-top: 6px;
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.4;
}

.aff-milestone-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 18px rgba(18, 63, 138, 0.04);
}

.aff-milestone-banner--progress {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.aff-milestone-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.aff-milestone-banner-bar .aff-progress-wrap {
  height: 8px;
  background: #e8eef5;
}

.aff-milestone-banner-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: #64748b;
}

.aff-milestone-banner-meta strong {
  color: var(--text-dark);
  font-weight: 700;
}

.aff-milestone-banner.is-claimable {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.aff-milestone-banner-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 13.5px;
  color: #475569;
}

.aff-milestone-banner-text strong {
  color: var(--text-dark);
  font-weight: 700;
}

.aff-milestone-banner.is-claimable .aff-milestone-banner-text strong {
  color: var(--primary-dark);
}

.aff-milestone-banner-link {
  flex-shrink: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.aff-milestone-banner-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.aff-pill-status--success {
  background: #dcfce7;
  color: #15803d;
}

.aff-pill-status--muted {
  background: #f1f5f9;
  color: #64748b;
}

.aff-milestone-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.aff-milestone-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: #64748b;
}

.aff-milestone-summary-pill {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  color: #475569;
}

.aff-milestone-summary-pill strong {
  color: var(--primary-dark);
}

.aff-milestone-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.aff-milestone-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.35;
}

.aff-milestone-desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.aff-milestone-reward {
  background: var(--bg-cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.aff-milestone-reward-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 3px;
}

.aff-milestone-reward-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.4;
}

.aff-milestone-progress .aff-progress-wrap {
  height: 8px;
  background: #e8eef5;
  margin-bottom: 8px;
}

.aff-milestone-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: #64748b;
}

.aff-milestone-progress-meta strong {
  color: var(--text-dark);
  font-weight: 700;
}

.aff-milestone-foot {
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}

.aff-milestone-status-note {
  margin: 0;
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
}

.aff-milestone-locked {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #64748b;
}

.aff-milestone-empty {
  text-align: center;
  padding: 40px 24px;
}

.aff-milestone-empty h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text-dark);
}

.aff-milestone-empty p {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
}

.aff-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.aff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: justify;
}

.aff-table th {
  background: #faf6ee;
  color: #475569;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.aff-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-dark);
  vertical-align: middle;
}

.aff-table tr:last-child td {
  border-bottom: none;
}

.aff-table tr:hover td {
  background: #fcfaf5;
}

/* =========================================================
   TABEL RIWAYAT TRANSAKSI KOMISI & PAGINATION
   ========================================================= */
.aff-col-no {
  width: 44px;
}

.aff-text-right {
  text-align: right;
}

.aff-text-center {
  text-align: center;
}

.aff-nowrap {
  white-space: nowrap;
}

.aff-tx-num {
  color: #64748b;
  font-size: 12.5px;
}

.aff-tx-date {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 13px;
}

.aff-tx-time {
  font-size: 11.5px;
  color: #64748b;
}

.aff-tx-cust {
  font-weight: 600;
}

.aff-tx-order {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 13px;
  white-space: nowrap;
}

.aff-tx-base {
  font-weight: 600;
  color: var(--text-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.aff-tx-amount {
  font-weight: 700;
  color: #15803d;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.aff-tx-type {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

.aff-tx-type.is-first {
  font-weight: 600;
  color: var(--primary);
}

.aff-tx-status {
  font-size: 13px;
  font-weight: 700;
}

.aff-tx-status--pending {
  color: #b45309;
}

.aff-tx-status--approved {
  color: #15803d;
}

.aff-tx-status--paid {
  color: var(--primary);
}

.aff-tx-status--cancelled {
  color: #b91c1c;
}

.aff-tx-empty {
  text-align: center;
  padding: 40px 20px !important;
  color: #64748b;
}

.aff-tx-empty strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--text-dark);
}

.aff-tx-empty span {
  font-size: 13px;
}

.aff-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.aff-pagination-info {
  color: #64748b;
}

.aff-pagination-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.aff-page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.aff-page-btn:hover {
  background: var(--bg-cream);
}

.aff-page-btn.is-active {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #ffffff;
}

.aff-page-ellipsis {
  padding: 6px 4px;
  color: #64748b;
}