/* ==========================================================================
   AFFILIATE CSS — MODERN NUMERICAL TYPOGRAPHY & CLEAN ENTERPRISE FINTECH
   ========================================================================== */

:root {
  --bg: #F4FCFB;
  --white: #FFFFFF;
  --sidebar-bg: #042F2E;
  --teal-soft: #E0F7F5;
  --teal-light: #B2EBE8;
  --teal-mid: #14B8A6;
  --teal-deep: #0D9488;
  --teal-dark: #0F5F58;
  --gold: #D97706;
  --gold-light: #FEF3C7;
  --text: #0A1F1E;
  --muted: #64748B;
  --border: #C8EDEA;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-head: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.aff-body {
  font-family: var(--font-body);
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
}

/* TOPBAR */
.aff-topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.aff-top-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.aff-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.aff-logo { font-size: 24px; }
.aff-title {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 800;
  color: var(--sidebar-bg);
  line-height: 1;
}
.aff-badge {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .8px;
  color: var(--teal-deep);
}

.aff-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-show-pass {
  background: var(--teal-soft);
  color: var(--teal-dark);
  border: 1px solid var(--teal-light);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.btn-show-pass:hover { background: var(--teal-light); }

.aff-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}
.aff-avatar {
  width: 34px;
  height: 34px;
  background: var(--sidebar-bg);
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.aff-uinfo { display: flex; flex-direction: column; }
.aff-uname { font-size: 12px; font-weight: 800; color: var(--sidebar-bg); }
.aff-uid { font-size: 10px; color: var(--teal-deep); font-weight: 700; font-variant-numeric: tabular-nums; }

/* MAIN DASHBOARD */
.aff-main {
  padding: 20px 16px 80px;
}
.aff-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* HERO BANNER */
.aff-hero-banner {
  background: linear-gradient(135deg, #042F2E 0%, #0D9488 100%);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.ah-tier-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .8px;
  background: rgba(254, 240, 138, 0.25);
  color: #FEF08A;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 6px;
}
.ah-title {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}
.ah-sub {
  font-size: 12.5px;
  color: #E0F7F5;
  margin: 0;
}
.btn-ah-action {
  background: white;
  color: var(--sidebar-bg);
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  transition: all .2s;
}
.btn-ah-action:hover { transform: translateY(-1px); }

/* CARDS */
.aff-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,.02);
}
.tc-title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 800;
  color: var(--sidebar-bg);
  margin: 0 0 2px;
}
.tc-sub { font-size: 12px; color: var(--muted); margin: 0; }
.tier-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.tc-month-pill {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  color: var(--sidebar-bg);
  font-variant-numeric: tabular-nums;
}

/* TIER PROGRESS METER */
.tier-progress-wrapper {
  margin-bottom: 12px;
}
.tier-milestones {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
@media (max-width: 600px) {
  .tier-milestones { grid-template-columns: 1fr 1fr; }
}
.tm-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}
.tm-item.done {
  background: #ECFDF5;
  border-color: #A7F3D0;
}
.tm-item.current {
  background: #FFFBEB;
  border-color: #FDE68A;
  border-width: 1.5px;
}
.tm-dot { font-size: 12px; display: block; margin-bottom: 2px; }
.tm-lbl { font-size: 10.5px; color: var(--muted); display: block; font-weight: 700; }
.tm-val { 
  font-family: var(--font-body);
  font-size: 15px; 
  font-weight: 800; 
  color: var(--sidebar-bg); 
  display: block; 
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.tm-item.current .tm-val { color: #B45309; }

.tier-bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.tier-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #F59E0B);
  border-radius: 10px;
}
.tier-footer-note {
  font-size: 12px;
  color: var(--sidebar-bg);
  background: var(--teal-soft);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

/* STATS GRID (CLEAN MODERN NUMBERS) */
.aff-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 860px) {
  .aff-stats-grid { grid-template-columns: 1fr 1fr; }
}
.astat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.astat-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}
.astat-val {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 800;
  color: var(--sidebar-bg);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.astat-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  display: block;
  margin-top: 4px;
}
.text-gold { color: #D97706; }
.text-green { color: #16A34A; }
.text-blue { color: #2563EB; }

/* TABS */
.aff-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 4px;
  overflow-x: auto;
}
.at-btn {
  padding: 9px 16px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.at-btn.active {
  background: var(--sidebar-bg);
  color: white;
}
.at-badge {
  font-size: 9px;
  background: #EF4444;
  color: white;
  padding: 1px 6px;
  border-radius: 10px;
}

/* LINK GEN */
.ac-title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 800;
  color: var(--sidebar-bg);
  margin: 0 0 2px;
}
.ac-sub { font-size: 12px; color: var(--muted); margin: 0 0 16px; }

.link-box-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.link-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  font-weight: 700;
  color: var(--sidebar-bg);
}
.btn-copy-link {
  padding: 10px 18px;
  background: var(--sidebar-bg);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

.promo-code-card {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: 1px solid #FCD34D;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pcc-tag { font-size: 10px; font-weight: 800; color: #92400E; }
.pcc-code { font-size: 24px; font-weight: 800; color: #78350F; margin: 2px 0; letter-spacing: 1px; }
.pcc-sub { font-size: 11.5px; color: #92400E; margin: 0; }
.btn-copy-code {
  background: #78350F;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
}

/* PAYSLIP TABLE & ALERT */
.payslip-alert-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pab-icon { font-size: 18px; }
.pab-text strong { display: block; font-size: 12px; color: #92400E; }
.pab-text p { font-size: 11.5px; color: #B45309; margin: 2px 0 0; line-height: 1.4; }

.payslips-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}
.aff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.aff-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}
.aff-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.aff-table td small { display: block; color: var(--muted); font-size: 10.5px; }

.tier-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}
.tier-pill.gold { background: #FEF3C7; color: #B45309; }
.tier-pill.platinum { background: #E0E7FF; color: #3730A3; }

.status-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
}
.status-tag.review { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
.status-tag.paid { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }

.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.btn-ps-action {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.btn-ps-action.review { background: #25D366; color: white; }
.btn-ps-action.print { background: var(--bg); border: 1px solid var(--border); color: var(--sidebar-bg); }

/* ================= DIGITAL AGENT PASS MODAL ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 47, 46, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}
.digital-pass-card {
  width: 100%;
  max-width: 380px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}
.btn-close-pass {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,.2);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

.dpc-header {
  background: linear-gradient(135deg, #042F2E 0%, #0F5F58 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dpc-logo-row { display: flex; align-items: center; gap: 8px; }
.dpc-crown { font-size: 24px; }
.dpc-brand strong { display: block; font-family: var(--font-body); font-size: 16px; font-weight: 800; line-height: 1; }
.dpc-brand span { font-size: 8.5px; font-weight: 800; letter-spacing: 1px; color: #A7F3D0; }
.dpc-verified-chip {
  font-size: 9px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.3);
  color: #6EE7B7;
  padding: 3px 8px;
  border-radius: 20px;
}

.dpc-body {
  padding: 20px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dpc-avatar-box {
  width: 64px;
  height: 64px;
  background: var(--bg);
  border: 2px solid var(--teal-mid);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 10px;
}
.dpc-name {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 800;
  color: var(--sidebar-bg);
  margin: 0 0 2px;
}
.dpc-role { font-size: 12.5px; color: var(--muted); display: block; }
.dpc-id-badge {
  display: inline-block;
  background: var(--sidebar-bg);
  color: white;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(4, 47, 46, 0.15);
}

.dpc-qr-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 12px auto 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dpc-qr-img { width: 140px; height: 140px; display: block; margin: 0 auto 6px; }
.dpc-qr-sub { font-size: 10px; color: var(--muted); font-weight: 700; display: block; }

.dpc-footer-terms {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.dpc-actions {
  display: flex;
  gap: 8px;
  padding: 0 20px 20px;
}
.btn-dpc-action {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.btn-dpc-action.print { background: var(--sidebar-bg); color: white; }
.btn-dpc-action.share { background: var(--bg); border: 1px solid var(--border); color: var(--sidebar-bg); }

/* ================= VERIFY PUBLIC PAGE ================= */
.verify-pass-card {
  width: 100%;
  max-width: 440px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: 0 16px 40px rgba(4, 47, 46, 0.08);
  text-align: center;
}
.vpc-badge-wrap {
  width: 60px;
  height: 60px;
  background: #DCFCE7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.vpc-icon-check {
  width: 44px;
  height: 44px;
  background: #16A34A;
  color: white;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vpc-status-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  background: #DCFCE7;
  color: #15803D;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 8px;
}
.vpc-title {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 800;
  color: var(--sidebar-bg);
  margin: 0 0 2px;
}
.vpc-role { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }
.vpc-id-pill {
  display: inline-block;
  background: var(--sidebar-bg);
  color: white;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}

.vpc-details-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.vpc-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.vpc-row .lbl { color: var(--muted); }
.vpc-row .val { font-weight: 700; color: var(--sidebar-bg); font-variant-numeric: tabular-nums; }

.vpc-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.vpc-actions { display: flex; flex-direction: column; gap: 8px; }
.vpc-btn-wa {
  background: #25D366;
  color: white;
  text-decoration: none;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  display: block;
}
.vpc-btn-home {
  background: var(--bg);
  color: var(--sidebar-bg);
  border: 1px solid var(--border);
  text-decoration: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
  display: block;
}
.vpc-footer { margin-top: 18px; font-size: 10px; color: var(--muted); }

/* TOAST */
.aff-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--sidebar-bg);
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all .3s ease;
  z-index: 9999;
}
.aff-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* ================= PROFILE SETTINGS STYLES ================= */
.form-section-header {
  font-size: 13px;
  font-weight: 800;
  color: var(--sidebar-bg);
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.aff-profile-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.aff-photo-preview-wrap {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid var(--teal-mid);
  overflow: hidden;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aff-photo-preview {
  font-size: 36px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}
.btn-upload-avatar {
  background: var(--sidebar-bg);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.btn-upload-avatar:hover { background: var(--teal-dark); }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

.form-group-aff {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.fg-lbl {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .4px;
  color: var(--sidebar-bg);
}
.fg-input, .fg-textarea {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: all .2s;
}
.fg-input:focus, .fg-textarea:focus {
  border-color: var(--teal-mid);
  background: white;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.kyc-mini-card {
  background: white;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kyc-mini-card:hover {
  border-color: var(--teal-mid);
  background: var(--bg);
}
.kmc-icon { font-size: 20px; }
.kmc-title { font-size: 11.5px; font-weight: 800; color: var(--sidebar-bg); }
.kmc-sub { font-size: 10px; color: var(--muted); }

.profile-submit-row {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.btn-save-profile {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-deep) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
  transition: all .2s;
}
.btn-save-profile:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
}
/* ================= ENTERPRISE PAYSLIP MODAL STYLES ================= */
.payslip-modal-card {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(4, 47, 46, 0.25);
  position: relative;
  border: 1px solid var(--border);
  padding: 32px 30px;
}
@media (max-width: 600px) {
  .payslip-modal-card { padding: 20px 16px; }
}

.btn-close-payslip {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.btn-close-payslip:hover { background: #FEF2F2; color: #DC2626; }

/* HEADER */
.psm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 2px solid var(--sidebar-bg);
  padding-bottom: 18px;
  margin-bottom: 20px;
}
.psm-brand { display: flex; align-items: flex-start; gap: 12px; }
.psm-logo-icon { font-size: 32px; }
.psm-company-name {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 800;
  color: var(--sidebar-bg);
  margin: 0 0 2px;
}
.psm-company-reg {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
}
.psm-address {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}

.psm-doc-tag { text-align: right; }
.psm-badge-type {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  background: #E0F2FE;
  color: #0369A1;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 4px;
}
.psm-doc-title {
  display: block;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 800;
  color: var(--sidebar-bg);
}
.psm-inv-num {
  font-size: 11.5px;
  font-weight: 800;
  color: #2563EB;
  font-variant-numeric: tabular-nums;
}

/* METADATA GRID */
.psm-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .psm-meta-grid { grid-template-columns: 1fr; }
}
.psm-col-lbl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}
.psm-payee-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--sidebar-bg);
  display: block;
}
.psm-payee-sub {
  font-size: 11.5px;
  color: var(--text);
  display: block;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.psm-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 3px;
}
.psm-meta-row span { color: var(--muted); }
.psm-meta-row strong { color: var(--sidebar-bg); font-variant-numeric: tabular-nums; }

/* TABLE */
.psm-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
}
.psm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.psm-table th {
  background: var(--sidebar-bg);
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
}
.psm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.psm-table td small { display: block; color: var(--muted); font-size: 10.5px; }

/* TOTALS SECTION */
.psm-totals-section {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 650px) {
  .psm-totals-section { grid-template-columns: 1fr; }
}

.psm-seal-box {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.psm-seal-icon {
  width: 24px;
  height: 24px;
  background: #16A34A;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.psm-seal-title { font-size: 11.5px; font-weight: 800; color: #166534; display: block; }
.psm-seal-sub { font-size: 10px; color: #15803D; margin: 2px 0 0; line-height: 1.35; }

.psm-calc-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.psm-calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-bottom: 4px;
}
.psm-calc-row strong { font-variant-numeric: tabular-nums; }
.psm-calc-row.gold strong { color: #D97706; font-weight: 800; }
.psm-calc-divider { border-top: 1.5px solid var(--border); margin: 8px 0; }
.psm-calc-row.total { align-items: flex-start; margin-bottom: 0; }
.tot-txt { font-size: 11px; font-weight: 800; color: var(--sidebar-bg); display: block; }
.tot-amount {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 800;
  color: var(--sidebar-bg);
  font-variant-numeric: tabular-nums;
}

/* NOTICE */
.psm-audit-notice {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
}
.psm-audit-notice strong { font-size: 11px; color: #92400E; display: block; }
.psm-audit-notice p { font-size: 10.5px; color: #B45309; margin: 2px 0 0; line-height: 1.4; }

/* ACTIONS ROW */
.psm-actions-row {
  display: flex;
  gap: 8px;
}
@media (max-width: 600px) {
  .psm-actions-row { flex-direction: column; }
}
.btn-psm-action {
  flex: 1;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.btn-psm-action.print { background: var(--sidebar-bg); color: white; }
.btn-psm-action.print:hover { background: var(--teal-dark); }
.btn-psm-action.wa { background: #25D366; color: white; }
.btn-psm-action.wa:hover { opacity: .9; }
.btn-psm-action.close { background: var(--bg); color: var(--sidebar-bg); border: 1px solid var(--border); flex: 0 0 80px; }

/* PRINT MEDIA */
@media print {
  body * { visibility: hidden; }
  #printablePayslipDocument, #printablePayslipDocument * { visibility: visible; }
  #printablePayslipDocument {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    border: none;
    padding: 0;
  }
  .btn-close-payslip, .psm-actions-row { display: none !important; }
}
/* ================= TOP 10 LIVE LEADERBOARD STYLES ================= */
.leaderboard-card {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 1.5px solid var(--border);
  position: relative;
  overflow: hidden;
}

.lb-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}
.lb-live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #DCFCE7;
  border: 1px solid #86EFAC;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  background: #16A34A;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
  animation: pulseLive 1.5s infinite;
}
@keyframes pulseLive {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.pulse-text {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .8px;
  color: #15803D;
}
.lb-title {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 800;
  color: var(--sidebar-bg);
  margin: 0 0 2px;
}
.lb-sub { font-size: 12px; color: var(--muted); margin: 0; }
.lb-month-badge {
  font-size: 11.5px;
  font-weight: 800;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  color: var(--sidebar-bg);
}

/* PODIUM GRID */
.lb-podium-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 22px;
}
@media (max-width: 720px) {
  .lb-podium-grid { grid-template-columns: 1fr; }
}

.podium-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,.03);
  transition: transform .2s;
}
.podium-card:hover { transform: translateY(-2px); }

.podium-card.rank-1 {
  background: linear-gradient(180deg, #FEFCE8 0%, #FFFFFF 100%);
  border-color: #FDE047;
  border-width: 2px;
  padding: 24px 16px;
  box-shadow: 0 8px 24px rgba(234, 179, 8, 0.12);
}
.crown-icon { font-size: 26px; margin-bottom: 2px; animation: bounceCrown 2s infinite ease-in-out; }
@keyframes bounceCrown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.podium-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 10px;
  letter-spacing: .4px;
}
.podium-badge.gold { background: #FEF08A; color: #854D0E; }
.podium-badge.silver { background: #E2E8F0; color: #334155; }
.podium-badge.bronze { background: #FED7AA; color: #9A3412; }

.podium-avatar {
  width: 52px;
  height: 52px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 8px;
}
.podium-avatar.gold-border {
  width: 62px;
  height: 62px;
  font-size: 30px;
  border-color: #EAB308;
  border-width: 3px;
}

.podium-name {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  color: var(--sidebar-bg);
  margin: 0 0 1px;
}
.podium-id { font-size: 10px; color: var(--muted); font-weight: 700; display: block; margin-bottom: 8px; }

.podium-stats {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 8px;
}
.ps-val { font-size: 13px; font-weight: 800; color: var(--sidebar-bg); }
.ps-amount { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 1px; }
.green-glow { color: #16A34A; font-size: 16px; }

.podium-tier-pill {
  font-size: 9.5px;
  font-weight: 800;
  background: var(--bg);
  color: var(--sidebar-bg);
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
}
.podium-tier-pill.gold-bg { background: #FEF08A; color: #854D0E; }

/* LEADERBOARD TABLE */
.lb-rankings-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 16px;
}
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.lb-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}
.lb-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.lb-rank-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--sidebar-bg);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
}

/* USER LIVE RANK STRIP */
.lb-user-rank-strip {
  background: linear-gradient(135deg, #042F2E 0%, #0D9488 100%);
  color: white;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.urs-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.urs-tag { font-size: 10px; font-weight: 800; color: #A7F3D0; letter-spacing: .5px; }
.urs-rank {
  background: #FEF08A;
  color: #854D0E;
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 20px;
}
.urs-details { font-size: 12px; font-weight: 700; color: #E0F7F5; }
.urs-boost-text { font-size: 12px; color: #FDE047; font-weight: 600; }
/* ================= COMPACT PSYCHO LEADERBOARD CSS ================= */
.compact-lb {
  padding: 16px 18px;
}

.lb-psycho-ticker {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.lpt-live-pill {
  background: #EF4444;
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
  animation: pulseLive 1.5s infinite;
}
.lpt-marquee {
  font-size: 11px;
  color: #92400E;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-gap-alert {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}

.lb-podium-grid.compact {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 700px) {
  .lb-podium-grid.compact { grid-template-columns: 1fr; }
}

.podium-card.compact {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.podium-card.rank-1.compact {
  padding: 12px 14px;
}
.crown-mini { font-size: 16px; display: block; margin-bottom: 2px; }

.podium-avatar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  margin: 6px 0;
}
.podium-avatar.mini {
  width: 36px;
  height: 36px;
  font-size: 18px;
  margin: 0;
  flex-shrink: 0;
}
.podium-avatar.mini.gold-border {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.podium-stats.compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  margin-bottom: 0;
  font-size: 11.5px;
}

.lb-table.compact th {
  padding: 6px 10px;
  font-size: 10px;
}
.lb-table.compact td {
  padding: 6px 10px;
  font-size: 11.5px;
}

.lb-user-rank-strip.compact {
  padding: 8px 14px;
  margin-top: 10px;
}
/* ================= MOBILE APP FIRST RESPONSIVE DESIGN (NATIVE FEEL) ================= */
@media (max-width: 650px) {
  .aff-main { padding: 12px 10px 80px; }
  .aff-container { gap: 12px; }
  .compact-lb { padding: 12px 10px; }

  .lb-header { flex-direction: column; gap: 6px; margin-bottom: 12px; }
  .lb-gap-alert { font-size: 10px; padding: 2px 8px; }

  /* TOP 3 NATIVE MINI PODIUM (3 IN 1 ROW HORIZONTAL) */
  .lb-podium-grid.compact {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
    align-items: flex-end !important;
  }

  .podium-card.compact {
    padding: 8px 4px !important;
    text-align: center !important;
  }
  .podium-card.rank-1.compact {
    padding: 10px 4px !important;
  }

  .podium-badge {
    font-size: 8px !important;
    padding: 2px 5px !important;
    margin-bottom: 4px !important;
    white-space: nowrap !important;
  }

  .podium-avatar-row {
    flex-direction: column !important;
    gap: 2px !important;
    text-align: center !important;
    margin: 2px 0 4px !important;
  }
  .podium-avatar.mini {
    width: 30px !important;
    height: 30px !important;
    font-size: 15px !important;
    margin: 0 auto !important;
  }
  .podium-avatar.mini.gold-border {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
  }

  .podium-name {
    font-size: 11px !important;
    line-height: 1.1 !important;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 auto !important;
  }
  .podium-id { display: none !important; }

  .podium-stats.compact {
    flex-direction: column !important;
    gap: 0 !important;
    padding: 4px 2px !important;
    font-size: 10px !important;
  }
  .ps-val { font-size: 10px !important; }
  .ps-amount { font-size: 11.5px !important; }

  /* MOBILE NATIVE LIST (NO SQUEEZED TABLES) */
  .lb-table.compact th {
    padding: 6px 4px !important;
    font-size: 9px !important;
  }
  .lb-table.compact td {
    padding: 6px 4px !important;
    font-size: 11px !important;
  }
  .lb-table.compact td small { display: none !important; }
  .tier-pill {
    font-size: 8.5px !important;
    padding: 2px 4px !important;
    white-space: nowrap !important;
  }

  /* USER STRIP MOBILE */
  .lb-user-rank-strip.compact {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    padding: 10px 12px !important;
  }
  .urs-left { gap: 4px !important; font-size: 11px !important; }
  .urs-boost-text { font-size: 11px !important; }
}

/* ================= SPECIFIC VENUE LINK GENERATOR CSS ================= */
.spec-venue-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
@media (max-width: 600px) {
  .spec-venue-actions { flex-direction: column; }
}

.btn-spec-action {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.btn-spec-action.wa { background: #25D366; color: white; }
.btn-spec-action.wa:hover { opacity: .9; }
.btn-spec-action.preview { background: var(--bg); border: 1.5px solid var(--border); color: var(--sidebar-bg); }
.btn-spec-action.preview:hover { background: var(--teal-soft); border-color: var(--teal-mid); }

/* ================= LEGAL POLICY BOX CSS ================= */
.aff-legal-policy-box {
  background: #FFFBEB;
  border: 1.5px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.alp-header {
  margin-bottom: 10px;
  border-bottom: 1px dashed #FCD34D;
  padding-bottom: 8px;
}
.alp-badge {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .8px;
  background: #FEF08A;
  color: #854D0E;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 4px;
}
.alp-header strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #78350F;
}
.alp-content {
  max-height: 180px;
  overflow-y: auto;
  font-size: 11px;
  color: #92400E;
  line-height: 1.55;
  padding-right: 6px;
}
.alp-content ul {
  padding-left: 18px;
  margin: 4px 0 6px;
}
.alp-content li {
  margin-bottom: 4px;
}

/* ================= VISUAL ILLUSTRATIONS & CREATOR GUIDE CSS ================= */
.aff-guide-section {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.ags-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--sidebar-bg);
  margin-bottom: 12px;
}
.ags-icon { font-size: 14px; }

/* 4 STEPS FLOW GRID */
.aff-step-flow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 600px) {
  .aff-step-flow-grid { grid-template-columns: 1fr 1fr; }
}

.asf-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.asf-card.highlight {
  background: #FEFCE8;
  border-color: #FDE047;
}
.asf-num {
  width: 18px;
  height: 18px;
  background: var(--sidebar-bg);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.asf-icon { font-size: 20px; margin-bottom: 2px; }
.asf-title { font-size: 11.5px; font-weight: 800; color: var(--sidebar-bg); margin-bottom: 2px; }
.asf-sub { font-size: 9.5px; color: var(--muted); line-height: 1.35; margin: 0; }

/* PROMO TACTICS GRID */
.aff-promo-tactics-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.apt-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: white;
  border: 1px solid rgba(134, 239, 172, 0.6);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.apt-icon { font-size: 20px; flex-shrink: 0; }
.apt-item strong { display: block; font-size: 11.5px; color: #14532D; margin-bottom: 1px; }
.apt-item p { font-size: 10.5px; color: #166534; line-height: 1.35; margin: 0; }

/* SOCIAL MEDIA CHANNELS PILLS */
.aff-social-channels-bar {
  border-top: 1px dashed rgba(134, 239, 172, 0.8);
  padding-top: 10px;
}
.asc-lbl {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .5px;
  color: #14532D;
  display: block;
  margin-bottom: 6px;
}
.asc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.asc-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 20px;
  background: white;
  border: 1px solid rgba(134, 239, 172, 0.8);
  color: #14532D;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
}
.asc-pill.tt { background: #000; color: #fff; border-color: #000; }
.asc-pill.ig { background: #E1306C; color: #fff; border-color: #E1306C; }
.asc-pill.fb { background: #1877F2; color: #fff; border-color: #1877F2; }
.asc-pill.wa { background: #25D366; color: #fff; border-color: #25D366; }
.asc-pill.tg { background: #229ED9; color: #fff; border-color: #229ED9; }
.asc-pill.yt { background: #FF0000; color: #fff; border-color: #FF0000; }

