.aff-page,.aff-admin { --aff-primary:#087e8b; --aff-ink:#27313d; --aff-muted:#74808d; --aff-line:#e7eaf0; color:var(--aff-ink); letter-spacing:0; }
.aff-page [hidden],.aff-admin [hidden] { display:none !important; }
.aff-page { max-width:1344px; padding:28px 40px 64px; }
.aff-icon { width:18px; height:18px; flex:0 0 18px; object-fit:contain; display:inline-block; vertical-align:middle; }
.aff-page .button,.aff-admin .button { display:inline-flex; align-items:center; justify-content:center; gap:9px; min-height:42px; padding:10px 16px; border-radius:6px; font-size:13px; line-height:1.4; font-weight:600; box-shadow:none; transition:background .15s,border-color .15s; }
.aff-page .button:hover,.aff-admin .button:hover { transform:none; background:#f0f4f9; border-color:#c6d0dc; }
.aff-page .button.primary,.aff-admin .button.primary { background:var(--aff-primary); color:#fff; border-color:var(--aff-primary); }
.aff-page .button.primary:hover,.aff-admin .button.primary:hover { background:#076a76; }
.aff-page .button.primary .aff-icon,.aff-admin .button.primary .aff-icon { filter:brightness(0) invert(1); }
.aff-page input,.aff-page select,.aff-admin input,.aff-admin select { font-family:inherit; font-size:13px; font-weight:400; letter-spacing:0; min-height:42px; border:1px solid #dce1e8; background:#fff; color:var(--aff-ink); border-radius:6px; padding:10px 12px; }
.aff-page input:focus,.aff-page select:focus,.aff-admin input:focus,.aff-admin select:focus { outline:2px solid #9bdfe4; outline-offset:2px; }
.aff-account-tabs { gap:28px; margin-bottom:28px; border-color:var(--aff-line); }
.aff-account-tabs a { font-size:13px; }
.aff-account-tabs a[aria-current] { background:transparent; color:var(--aff-primary); border-color:var(--aff-primary); }
.aff-heading { margin:0 0 24px; }
.aff-heading .eyebrow { display:flex; align-items:center; gap:8px; color:#087e8b; font-size:11px; font-weight:700; margin:0 0 10px; }
.aff-heading h1 { font-size:32px; line-height:1.2; margin:0 0 8px; color:#26303e; }
.aff-heading p { font-size:13px; margin:0; color:var(--aff-muted); }
.aff-invite-tag { display:inline-flex; align-items:center; gap:8px; border:1px solid #dce8ea; background:#e9f8f7; color:#25616b; font-size:12px; font-weight:600; padding:9px 12px; border-radius:6px; }
.aff-invite-tag .aff-icon { width:15px; height:15px; }
.aff-badge { border-radius:4px; font-size:11px; font-weight:600; padding:5px 9px; }
.aff-badge::before { content:""; width:5px; height:5px; background:currentColor; border-radius:50%; margin:5px 6px 0 0; flex-shrink:0; }
.aff-application-layout { display:grid; grid-template-columns:minmax(280px,.85fr) minmax(0,1.15fr); gap:44px; align-items:start; padding:24px 0; border-top:1px solid var(--aff-line); }
.aff-intro { padding:0; }
.aff-intro h2 { font-size:25px; line-height:1.3; color:#26303e; margin:0 0 12px; }
.aff-intro > p { font-size:14px; line-height:1.7; color:#6b7786; }
.aff-intro .aff-terms-copy { font-size:12px; line-height:1.8; }
.aff-slots { gap:12px; padding:16px 0 10px; }
.aff-slots > div { border:0; border-radius:8px; padding:20px; gap:9px; }
.aff-slots > div:first-child { background:#e3f6f4; border:0; }
.aff-slots > div:nth-child(2) { background:#f0edff; border:0; }
.aff-slots > div:nth-child(3) { background:#fff0e8; border:0; }
.aff-slots strong { font-size:30px; color:#26303e; }
.aff-slots > div > span { font-size:12px; color:#627281; }
.aff-slots b { font-size:12px; }
.aff-slots > p { font-size:11px; line-height:1.7; margin-top:6px; color:#74808d; }
.aff-slots progress { height:5px; accent-color:var(--aff-primary); }
.aff-slots progress::-webkit-progress-bar { background:#ffffffa6; }
.aff-slots progress::-webkit-progress-value { background:#087e8b; }
.aff-intro .aff-slots { grid-template-columns:1fr; }
.aff-intro .aff-slots > div { display:grid; grid-template-columns:74px 1fr; align-items:center; gap:4px 14px; padding:16px 20px; }
.aff-intro .aff-slots strong { grid-row:1/3; }
.aff-intro .aff-slots progress { grid-column:1/-1; margin-top:8px; }
.aff-application-form { margin:0; padding:28px; border:1px solid #e4e8f0; background:#fff; border-radius:8px; box-shadow:0 4px 20px #28394f05; }
.aff-form-steps { display:flex; gap:24px; padding-bottom:24px; border-bottom:1px solid #edf0f5; }
.aff-form-steps > span { display:flex; align-items:center; gap:9px; font-size:12px; color:#8b94a2; font-weight:600; }
.aff-form-steps b { display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:#eef1f7; font-size:11px; }
.aff-form-steps .is-current { color:#087e8b; }
.aff-form-steps .is-current b,.aff-form-steps .is-complete b { background:#d6f1f2; color:#087e8b; }
.aff-form-grid { display:block; }
.aff-form-grid fieldset { border:0; padding:0; margin:22px 0 0; display:grid; grid-template-columns:1fr 1fr; gap:20px 16px; min-width:0; }
.aff-form-grid legend { font-size:18px; font-weight:650; margin-bottom:18px; padding:0; color:#26303e; }
.aff-form-grid label { display:grid; gap:8px; font-size:12px; font-weight:600; color:#526071; }
.aff-form-grid label:has(input[name="bank_holder"]) { grid-column:1/-1; }
.aff-application-form .aff-form-grid fieldset { grid-template-columns:1fr; }
.aff-form-grid input { width:100%; min-width:0; background:#fdfdff; }
.aff-form-actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; padding-top:24px; margin-top:8px; border-top:1px solid #edf0f5; }
.aff-profile .aff-check { font-size:11px; line-height:1.7; color:#73808d; margin:20px 0 0; }
.aff-profile .aff-check input { width:16px; min-height:16px; height:16px; margin-top:3px; }
.aff-member-strip { display:flex; gap:20px; flex-wrap:wrap; align-items:center; font-size:12px; color:#6c7b89; padding:14px 0 20px; border-top:1px solid var(--aff-line); }
.aff-member-strip > span { display:flex; align-items:center; gap:7px; }
.aff-member-strip strong { color:#087e8b; padding:5px 9px; background:#e0f5f5; border-radius:4px; }
.aff-member-strip > span:first-child { color:#384754; }
.aff-verified { display:flex; align-items:center; gap:12px; background:#eaf7f2; border:0; border-radius:6px; padding:14px 18px; margin:0 0 20px; }
.aff-verified > .aff-icon { width:22px; height:22px; }
.aff-verified strong { font-size:13px; }
.aff-verified p { margin:3px 0 0; font-size:12px; }
.aff-pending-banner { display:flex; gap:10px; align-items:center; padding:14px 18px; border-radius:6px; background:#fff3dc; color:#755523; font-size:12px; line-height:1.6; }
.aff-quota-details { background:transparent; margin:16px 0; border:0; border-bottom:1px solid var(--aff-line); border-radius:0; padding:0 0 16px; box-shadow:none; }
.aff-quota-details > summary { cursor:pointer; display:flex; align-items:center; gap:12px; font-size:12px; font-weight:600; color:#617184; list-style:none; padding:4px 0; }
.aff-quota-details > summary::-webkit-details-marker { display:none; }
.aff-quota-details > summary small { font-weight:400; margin-left:auto; color:#8a94a3; }
.aff-quota-details > summary > .aff-icon { width:14px; height:14px; margin-left:auto; transition:transform .15s; }
.aff-quota-details[open] > summary > .aff-icon { transform:rotate(90deg); }
.aff-quota-details > summary small + .aff-icon { margin-left:0; }
.aff-metrics { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; border:0; background:transparent; padding:0; margin:20px 0 28px; }
.aff-metrics > div { border:1px solid #e3e7ef; border-radius:8px; padding:18px 16px; background:#fff; min-width:0; }
.aff-metrics > div:nth-child(3) { background:#e8f6f6; border-color:#d0e9eb; }
.aff-metrics > div > span { display:flex; align-items:center; gap:7px; font-size:11px; color:#74808e; }
.aff-metrics > div > span .aff-icon { width:15px; height:15px; flex-basis:15px; opacity:.65; }
.aff-metrics strong { margin-top:16px; font-size:25px; font-weight:650; line-height:1.2; color:#27313e; }
.aff-workspace { margin-top:20px; min-width:0; }
.aff-view-tabs { display:flex; align-items:stretch; gap:6px; border-bottom:1px solid #e2e7ee; padding-bottom:8px; margin-bottom:24px; overflow-x:auto; }
.aff-view-tabs > button { display:inline-flex; gap:8px; align-items:center; justify-content:center; flex-shrink:0; padding:11px 16px; min-height:42px; border:0; background:transparent; color:#718092; border-radius:6px; font-family:inherit; font-size:12px; font-weight:600; cursor:pointer; transition:background .15s; white-space:nowrap; }
.aff-view-tabs > button:hover { background:#edf2f8; }
.aff-view-tabs > button[aria-selected="true"] { color:#2c566b; background:#e2f1f5; }
.aff-view-tabs > button .aff-icon { width:16px; height:16px; flex-basis:16px; opacity:.75; }
.aff-view-tabs > button b { min-width:20px; text-align:center; font-size:10px; background:#fff; border-radius:4px; padding:3px 5px; }
.aff-view { min-width:0; padding:0 0 20px; animation:aff-appear .18s ease-out; }
@keyframes aff-appear { from {opacity:.4;transform:translateY(3px);} to {opacity:1;transform:translateY(0);} }
.aff-view-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 20px; min-height:36px; }
.aff-view-head h2,.aff-view-head h3 { font-size:19px; margin:0; color:#27313e; }
.aff-view-head p,.aff-view-head > span { font-size:12px; color:#84909e; margin:6px 0 0; }
.aff-view-head select { max-width:240px; }
.aff-ledger-note { margin:-6px 0 18px; padding:13px 15px; border:1px solid #cde7e4; border-radius:6px; background:#f1faf8; color:#55706f; font-size:12px; line-height:1.6; }
.aff-ledger-note strong { color:#087e8b; }
.aff-action-wait { display:block; max-width:190px; color:#9a7740; font-size:12px; }
.aff-action-wait small,.aff-admin-form button + small { display:block; margin-top:7px; color:#84909e; font-size:10px; line-height:1.5; }
.aff-link-row { display:grid; grid-template-columns:64px minmax(0,1fr) 42px 42px; gap:18px; align-items:center; padding:18px 0; border-top:1px solid #e7ecf2; }
.aff-module-cover { width:64px; height:80px; object-fit:contain; background:#e9edf5; border-radius:5px; }
.aff-link-info strong { display:block; font-size:14px; font-weight:600; }
.aff-link-info > small { display:flex; align-items:center; gap:6px; margin:6px 0 10px; font-size:11px; color:#8a94a3; }
.aff-link-info > small .aff-icon { width:13px; height:13px; flex-basis:13px; opacity:.6; }
.aff-link-info > small > span { margin-left:12px; color:#138391; background:#edf8f7; border-radius:4px; padding:3px 7px; }
.aff-link-info input { max-width:680px; padding:7px 10px; min-height:34px; font-size:12px; font-weight:400; color:#788395; border-color:#e6eaf0; background:#fff; }
.aff-page .aff-icon-button { width:42px; height:42px; min-height:42px; padding:10px; position:relative; }
.aff-copy-success { display:none; }
[data-copied] > .aff-icon { display:none; }
[data-copied] > .aff-copy-success { display:inline-flex; }
.aff-toolbar { display:flex; align-items:center; gap:12px; margin:0 0 16px; }
.aff-search { display:flex; gap:8px; align-items:center; min-width:0; flex:1; max-width:380px; border:1px solid #e1e6ee; border-radius:6px; padding-left:12px; background:#fff; }
.aff-search .aff-icon { width:16px; height:16px; flex-basis:16px; opacity:.45; }
.aff-toolbar .aff-search input { border:0; background:transparent; width:100%; min-width:0; box-shadow:none; font-size:12px; padding-left:0; }
.aff-toolbar > select { margin-left:auto; min-width:140px; font-size:12px; }
.aff-filter-empty { padding:24px 0; font-size:13px; color:#8b96a4; }
.aff-table { border:1px solid #e5e9f0; border-radius:6px; }
.aff-table th { background:#f4f6fb; color:#8993a3; font-size:10px; padding:14px 16px; }
.aff-table td { border-color:#edf0f5; font-size:13px; padding:18px 16px; vertical-align:middle; }
.aff-table td strong { font-size:13px; font-weight:600; }
.aff-table small { color:#7b8797; font-size:11px; font-weight:400; line-height:1.6; }
.aff-table tbody tr:hover { background:#fbfcff; }
.aff-empty-state { display:flex; align-items:center; gap:12px; padding:36px 24px; border:1px dashed #dce4ec; background:#f9fbfe; color:#8c97a5; font-size:13px; border-radius:6px; }
.aff-mini-label { display:block; color:#83909e; font-size:10px; font-weight:600; margin:0 0 10px; }
.aff-wallet-amount { display:block; font-size:36px; font-weight:650; color:#087e8b; line-height:1.3; }
.aff-withdraw { padding:4px 0 24px; margin-bottom:24px; border-color:var(--aff-line); }
.aff-withdraw p { color:#8792a1; font-size:12px; }
.aff-admin { border-radius:8px; padding:24px !important; box-shadow:0 2px 16px #26354b04; border-color:#e5e8ef; background:#fff; }
.aff-admin > .admin-card-head { align-items:center; margin-bottom:20px; }
.aff-admin > .admin-card-head h2 { font-size:23px; margin:0; }
.aff-admin .aff-table table { min-width:780px; }
.aff-admin-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; border-top:1px solid #edf0f5; padding:22px 0; }
.aff-admin-summary > div { display:flex; align-items:center; gap:14px; }
.aff-admin-summary > div > .aff-icon { width:40px; height:40px; padding:11px; border-radius:8px; background:#e9f7f6; flex-basis:40px; }
.aff-admin-summary > div:nth-child(2) > .aff-icon { background:#fff0e7; }
.aff-admin-summary > div:nth-child(3) > .aff-icon { background:#eeebfc; }
.aff-admin-summary span { font-size:11px; color:#84909e; }
.aff-admin-summary strong { display:block; margin-top:5px; color:#283345; font-size:24px; font-weight:650; }
.aff-person { display:flex; align-items:center; gap:10px; }
.aff-avatar { display:grid; place-items:center; width:32px; height:32px; flex-shrink:0; border-radius:50%; background:#ebeff9; color:#777c9e; font-size:12px; font-weight:600; }
.aff-actions { padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; margin:0; min-width:95px; }
.aff-actions > summary { cursor:pointer; display:inline-flex; align-items:center; gap:12px; padding:8px 12px; border:1px solid #e1e7ee; border-radius:5px; font-size:11px; font-weight:600; color:#5d6c7e; list-style:none; }
.aff-actions > summary::-webkit-details-marker { display:none; }
.aff-actions > summary .aff-icon { width:13px; height:13px; flex-basis:13px; }
.aff-actions[open] > summary .aff-icon { transform:rotate(90deg); }
.aff-action-body { width:210px; padding:14px 0 0; }
.aff-action-body label { display:grid; gap:7px; width:100%; font-size:11px; color:#7e8b9b; }
.aff-action-body .aff-admin-form { margin:0 0 10px; }
.aff-action-body input,.aff-action-body select { width:100%; font-size:12px; }
.aff-action-body button { width:100%; }
.aff-module-list { display:block; padding:0; }
.aff-module-list .aff-admin-form { display:flex; align-items:center; gap:14px; border-bottom:1px solid #eef1f6; padding:18px 0; margin:0; flex-wrap:nowrap; }
.aff-module-list strong { flex:1; min-width:0; font-size:13px; }
.aff-module-symbol { padding:10px; background:#edf3fa; border-radius:6px; }
.aff-toggle { display:inline-flex; position:relative; width:38px; height:22px; flex-shrink:0; cursor:pointer; }
.aff-toggle input { position:absolute; width:38px; height:22px; opacity:0; margin:0; min-height:0; }
.aff-toggle > span { width:38px; height:22px; border-radius:15px; background:#dce2ec; transition:background .15s; }
.aff-toggle > span::before { content:""; display:block; width:16px; height:16px; margin:3px; background:white; border-radius:50%; box-shadow:0 1px 3px #19273b26; transition:transform .15s; }
.aff-toggle input:checked + span { background:#148c97; }
.aff-toggle input:checked + span::before { transform:translateX(16px); }
.aff-toggle input:focus-visible + span { outline:2px solid #71cbd5; outline-offset:3px; }
@media(max-width:1000px) {
  .aff-application-layout { gap:24px; grid-template-columns:minmax(220px,.8fr) minmax(0,1.2fr); }
  .aff-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .aff-link-row > div { grid-column:auto; }
}
@media(max-width:700px) {
  .aff-page { padding:22px 20px 44px; }
  .aff-application-layout { grid-template-columns:1fr; gap:28px; }
  .aff-application-form { padding:22px; }
  .aff-form-grid fieldset { grid-template-columns:1fr; }
  .aff-intro h2 { font-size:23px; }
  .aff-heading h1 { font-size:28px; }
  .aff-heading .aff-invite-tag { display:none; }
  .aff-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .aff-metrics > div { padding:15px 12px; }
  .aff-metrics > div:last-child { grid-column:1/-1; }
  .aff-metrics strong { font-size:23px; margin-top:12px; }
  .aff-member-strip { gap:12px; font-size:11px; }
  .aff-view-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-bottom:22px; overflow:visible; }
  .aff-view-tabs > button { justify-content:flex-start; padding:10px 12px; font-size:11px; min-width:0; }
  .aff-view-head { align-items:flex-start; flex-wrap:wrap; }
  .aff-view-head h2,.aff-view-head h3 { font-size:18px; }
  .aff-view-head select { width:100%; max-width:none; }
  .aff-link-row { grid-template-columns:52px minmax(0,1fr) 36px 36px; gap:8px; align-items:start; padding:18px 0; }
  .aff-module-cover { width:52px; height:66px; }
  .aff-link-info strong { font-size:12px; }
  .aff-link-info > small { flex-wrap:wrap; font-size:10px; }
  .aff-link-info > small > span { margin-left:0; }
  .aff-link-info input { grid-column:auto; min-height:34px; width:100%; font-size:10px; }
  .aff-page .aff-icon-button { width:36px; height:36px; min-height:36px; padding:8px; }
  .aff-toolbar { gap:8px; align-items:stretch; }
  .aff-toolbar > select { min-width:108px; max-width:135px; font-size:11px; }
  .aff-toolbar .aff-search input { font-size:11px; }
  .aff-search { padding-left:8px; gap:6px; }
  .aff-admin { padding:16px !important; }
  .aff-admin-summary { gap:12px; }
  .aff-admin-summary > div { flex-direction:column; align-items:flex-start; gap:10px; }
  .aff-admin-summary > div > .aff-icon { width:34px; height:34px; flex-basis:34px; padding:9px; }
  .aff-admin-summary span { font-size:10px; }
  .aff-admin-summary strong { font-size:22px; }
  .aff-admin > .admin-card-head h2 { font-size:21px; }
  .aff-admin > .admin-card-head { display:flex; flex-direction:row; align-items:flex-start; justify-content:space-between; }
  .aff-admin > .admin-card-head > .aff-invite-tag { display:none; }
  .aff-quota-details > summary { flex-wrap:wrap; }
  .aff-quota-details > summary small { margin-left:0; font-size:10px; }
  .aff-slots { grid-template-columns:1fr; }
  .aff-slots > div { display:grid; grid-template-columns:70px 1fr; align-items:center; }
  .aff-slots strong { grid-row:1/3; }
  .aff-slots progress { grid-column:1/-1; }
  .aff-table { overflow:visible; }
  .aff-table table,.aff-admin .aff-table table { display:block; min-width:0; width:100%; }
  .aff-table thead { display:none; }
  .aff-table tbody { display:block; }
  .aff-table tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:8px 0; border-bottom:1px solid #e7edf4; }
  .aff-table tbody tr:last-child { border-bottom:0; }
  .aff-table td { display:block; padding:10px 14px; border:0; min-width:0; text-align:left; }
  .aff-table td:first-child,.aff-table td:last-child { grid-column:1/-1; }
  .aff-table td::before { content:attr(data-label); display:block; font-size:10px; font-weight:400; color:#8592a4; margin-bottom:7px; }
  .aff-action-body { width:100%; max-width:100%; }
}
@media(prefers-reduced-motion:reduce) { .aff-view { animation:none; } .aff-page *,.aff-admin * { transition:none !important; } }
.aff-performance{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:center;margin:20px 0;padding:22px;border:1px solid #d9d4ff;border-radius:22px;background:linear-gradient(135deg,#f5f2ff,#ecfffa)}
.aff-performance h2{margin:4px 0;font-size:30px}.aff-performance p,.aff-performance span{display:block;color:#667085}.aff-performance progress{width:100%;height:10px;margin-top:10px;accent-color:#7557ed}
@media(max-width:720px){.aff-performance{grid-template-columns:1fr;padding:18px;border-radius:18px}.aff-performance h2{font-size:25px}}

.referral-report { max-width: 1100px; margin: auto; padding: 24px 16px 48px; }
.referral-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.referral-filters [aria-current="page"] { background: #087c79; color: white; }
.referral-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.referral-card { padding: 18px; border: 1px solid #dbe5e7; border-radius: 16px; background: white; overflow-wrap: anywhere; }
.referral-card h2 { font-size: 1.15rem; margin: 0 0 4px; }
.referral-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 0; }
.referral-card dt { font-size: .82rem; }
.referral-card dd { margin: 4px 0 0; font-weight: 700; }

/* ==========================================================================
   Partner Monitor (/admin/referrals) - modern layer. Scoped to .referral-report
   ========================================================================== */
body:has(.referral-report) { background:#f3f6fb; }
.referral-report { --r-ink:#0f1b2d; --r-text:#33445a; --r-muted:#6f7f94; --r-line:#e3e9f1; --r-teal:#0f8f98; --r-teal2:#17b3a6; --r-soft:#e4f6f5;
  --r-shadow:0 1px 2px #0f1b2d0a,0 8px 28px -12px #0f1b2d1f; --r-shadow-lg:0 2px 4px #0f1b2d0a,0 22px 48px -18px #0f1b2d38; --r-ease:cubic-bezier(.22,1,.36,1);
  position:relative; isolation:isolate; max-width:1180px; margin:0 auto; padding:22px 18px 56px; color:var(--r-text); }
.referral-report::before { content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:radial-gradient(800px 480px at 6% -6%,#17b3a62e,transparent 60%),radial-gradient(700px 440px at 100% 0,#6d5efc20,transparent 60%),#f3f6fb;
  background-size:140% 140%,130% 130%,auto; animation:refAurora 22s ease-in-out infinite alternate; }
@keyframes refAurora { from{background-position:0 0,100% 0,0 0} to{background-position:12% 8%,88% 12%,0 0} }
@keyframes refRise { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:none} }

/* Hero */
.referral-report .ref-hero { position:relative; overflow:hidden; margin:0 0 18px; padding:22px 26px 26px; border-radius:22px; color:#fff;
  background:linear-gradient(120deg,#0b1a2e 0%,#0e3c4f 50%,#0f8f98 100%); box-shadow:var(--r-shadow-lg); animation:refRise .7s var(--r-ease) both; }
.referral-report .ref-hero::before { content:""; position:absolute; width:340px; height:340px; right:-80px; top:-170px; border-radius:50%; background:radial-gradient(circle,#5eead4aa,transparent 65%); animation:refFloat 9s ease-in-out infinite alternate; pointer-events:none; }
.referral-report .ref-hero::after { content:""; position:absolute; inset:0; opacity:.5; pointer-events:none; background:linear-gradient(115deg,transparent 35%,#ffffff1c 50%,transparent 65%); transform:translateX(-120%); animation:refSheen 7s 1.2s ease-in-out infinite; }
@keyframes refFloat { from{transform:translate(0,0) scale(1)} to{transform:translate(-36px,32px) scale(1.18)} }
@keyframes refSheen { 0%,55%{transform:translateX(-120%)} 100%{transform:translateX(120%)} }
.referral-report .ref-hero > * { position:relative; z-index:1; }
.referral-report .ref-back { display:inline-flex; align-items:center; gap:6px; padding:7px 12px; margin-bottom:16px; border:1px solid #ffffff2e; border-radius:99px; background:#ffffff14; color:#d8eef0; font-size:12px; font-weight:600; transition:background .2s,transform .25s var(--r-ease); }
.referral-report .ref-back:hover { background:#ffffff26; transform:translateX(-3px); color:#fff; }
.referral-report .ref-hero-body { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; flex-wrap:wrap; }
.referral-report .ref-eyebrow { margin:0 0 8px; color:#8fe9df; font-size:11px; font-weight:700; letter-spacing:.16em; }
.referral-report .ref-hero h1 { margin:0 0 8px; color:#fff; font-size:clamp(26px,4vw,38px); font-weight:780; letter-spacing:-.025em; line-height:1.15; }
.referral-report .ref-hero p:not(.ref-eyebrow) { margin:0; max-width:560px; color:#b7cbd8; font-size:13px; line-height:1.65; }
.referral-report .ref-period { display:inline-flex; align-items:center; gap:9px; padding:10px 16px; border:1px solid #ffffff2e; border-radius:99px; background:#ffffff17; backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); color:#fff; font-size:13px; font-weight:650; white-space:nowrap; }
.referral-report .ref-period i { width:8px; height:8px; border-radius:50%; background:#34d399; animation:refPulse 2.2s ease-out infinite; }
@keyframes refPulse { 0%{box-shadow:0 0 0 0 #34d399aa} 80%,100%{box-shadow:0 0 0 10px #34d39900} }

/* Filters: segmented, scrollable on phones */
.referral-report .referral-filters { display:flex; flex-wrap:nowrap; gap:4px; width:fit-content; max-width:100%; margin:0 0 18px; padding:5px; overflow-x:auto; scrollbar-width:none; border:1px solid var(--r-line); border-radius:14px; background:#ffffffcc; backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); box-shadow:var(--r-shadow); animation:refRise .6s .08s var(--r-ease) both; }
.referral-report .referral-filters::-webkit-scrollbar { display:none; }
.referral-report .referral-filters .button { flex:0 0 auto; width:auto; min-width:max-content; min-height:38px; padding:8px 14px; border:0; border-radius:10px; background:transparent; color:#6f7f94; font-size:12px; font-weight:650; box-shadow:none; white-space:nowrap; transition:background .25s var(--r-ease),color .2s,box-shadow .25s,transform .2s; }
.referral-report .referral-filters .button:hover { background:#eef4f8; color:var(--r-ink); transform:none; }
.referral-report .referral-filters .button:active { transform:scale(.95); }
.referral-report .referral-filters [aria-current="page"] { background:linear-gradient(135deg,#0f8f98,#17b3a6); color:#fff; box-shadow:0 8px 16px -8px #0f8f98cc; }
.referral-report .referral-filters [aria-current="page"]:hover { background:linear-gradient(135deg,#0c7f88,#13a398); color:#fff; }

/* Summary tiles */
.referral-report .ref-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin:0 0 22px; }
.referral-report .ref-stat { position:relative; overflow:hidden; padding:18px 18px 20px; border:1px solid var(--r-line); border-radius:16px; background:linear-gradient(160deg,#fff,#f6f9fc); box-shadow:var(--r-shadow);
  animation:refRise .6s var(--r-ease) calc(var(--i,0) * 70ms + 160ms) both; transition:transform .35s var(--r-ease),box-shadow .35s; }
.referral-report .ref-stat::after { content:""; position:absolute; right:-24px; top:-24px; width:84px; height:84px; border-radius:50%; background:var(--chip,#17b3a6); opacity:.12; transition:transform .5s var(--r-ease); }
.referral-report .ref-stat:hover { transform:translateY(-4px); box-shadow:var(--r-shadow-lg); }
.referral-report .ref-stat:hover::after { transform:scale(1.9); }
.referral-report .ref-stat-orders { --chip:#17b3a6; background:linear-gradient(160deg,#fff,#f1fbfa); }
.referral-report .ref-stat-revenue { --chip:#6d5efc; background:linear-gradient(160deg,#fff,#f5f3ff); }
.referral-report .ref-stat-commission { --chip:#f59e0b; background:linear-gradient(160deg,#fff,#fff8ec); }
.referral-report .ref-stat-available { --chip:#e5516a; background:linear-gradient(160deg,#fff,#fff3f5); }
.referral-report .ref-stat-label { display:block; color:var(--r-muted); font-size:12px; font-weight:600; }
.referral-report .ref-stat strong { position:relative; display:block; margin-top:12px; color:var(--r-ink); font-size:clamp(22px,2.4vw,30px); font-weight:780; letter-spacing:-.03em; font-variant-numeric:tabular-nums; }

/* Ranking cards */
.referral-report .referral-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr)); gap:16px; }
.referral-report .referral-card { position:relative; overflow:hidden; padding:20px; border:1px solid var(--r-line); border-radius:18px; background:linear-gradient(170deg,#fff,#f8fbfd); box-shadow:var(--r-shadow);
  animation:refRise .6s var(--r-ease) calc(var(--i,0) * 60ms + 260ms) both; transition:transform .35s var(--r-ease),box-shadow .35s,border-color .3s; }
.referral-report .referral-card:hover { transform:translateY(-5px); box-shadow:var(--r-shadow-lg); border-color:#c9e4e4; }
.referral-report .referral-card.is-top-1 { border-color:#f2d58f; background:linear-gradient(170deg,#fffdf6,#fff7e2); }
.referral-report .referral-card.is-top-2 { border-color:#d5dbe5; background:linear-gradient(170deg,#fff,#f3f6fa); }
.referral-report .referral-card.is-top-3 { border-color:#efcfb2; background:linear-gradient(170deg,#fffdfb,#fff3e8); }
.referral-report .referral-card.is-idle { opacity:.82; }
.referral-report .ref-card-head { display:flex; align-items:center; gap:12px; margin:0 0 14px; }
.referral-report .ref-avatar { flex:0 0 44px; width:44px; height:44px; display:grid; place-items:center; border-radius:14px; color:#fff; font-size:15px; font-weight:750; letter-spacing:.02em; background:linear-gradient(135deg,#0f8f98,#17b3a6); box-shadow:0 8px 16px -8px #0f8f98cc; transition:transform .4s var(--r-ease); }
.referral-report .referral-card:hover .ref-avatar { transform:rotate(-6deg) scale(1.08); }
.referral-report .is-top-1 .ref-avatar { background:linear-gradient(135deg,#f59e0b,#fbbf24); box-shadow:0 8px 16px -8px #f59e0bcc; }
.referral-report .is-top-2 .ref-avatar { background:linear-gradient(135deg,#64748b,#94a3b8); box-shadow:0 8px 16px -8px #64748bcc; }
.referral-report .is-top-3 .ref-avatar { background:linear-gradient(135deg,#c2410c,#ea8a4a); box-shadow:0 8px 16px -8px #c2410ccc; }
.referral-report .is-idle .ref-avatar { background:linear-gradient(135deg,#94a3b8,#b6c2d2); box-shadow:none; }
.referral-report .ref-card-title { min-width:0; flex:1; }
.referral-report .referral-card h2 { margin:0 0 3px; font-size:16px; font-weight:720; letter-spacing:-.01em; color:var(--r-ink); line-height:1.3; overflow-wrap:anywhere; }
.referral-report .ref-card-title small { display:block; color:var(--r-muted); font-size:11px; font-weight:500; }
.referral-report .ref-card-title small b { padding:2px 8px; border-radius:99px; background:#eef2f7; color:#4a5d75; font-weight:650; }
.referral-report .ref-rank { flex:0 0 auto; padding:6px 11px; border-radius:99px; background:var(--r-soft); color:#0b6870; font-size:13px; font-weight:780; }
.referral-report .is-top-1 .ref-rank { background:#fdecc0; color:#8a5a00; }
.referral-report .is-top-2 .ref-rank { background:#e6ebf2; color:#475569; }
.referral-report .is-top-3 .ref-rank { background:#fbe0cb; color:#9a3412; }
.referral-report .ref-rank.is-idle { background:#eef2f7; color:#7b8aa0; font-size:11px; font-weight:650; }
.referral-report .ref-bar { height:6px; margin:0 0 16px; border-radius:99px; background:#e6ecf3; overflow:hidden; }
.referral-report .ref-bar i { display:block; width:var(--w,0%); height:100%; border-radius:99px; background:linear-gradient(90deg,#17b3a6,#6d5efc); transform-origin:left; animation:refBar 1s var(--r-ease) calc(var(--i,0) * 60ms + 450ms) both; }
.referral-report .is-top-1 .ref-bar i { background:linear-gradient(90deg,#f59e0b,#fbbf24); }
@keyframes refBar { from{transform:scaleX(0)} to{transform:scaleX(1)} }
.referral-report .referral-card dl { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:0; }
.referral-report .referral-card dl > div { padding:12px 13px; border:1px solid #edf1f6; border-radius:12px; background:#ffffffb8; transition:background .25s,border-color .25s; }
.referral-report .referral-card:hover dl > div { background:#fff; border-color:#dde7ee; }
.referral-report .referral-card dl > .is-available { background:linear-gradient(135deg,#effbf9,#e4f6f5); border-color:#cdeceb; }
.referral-report .referral-card dt { color:var(--r-muted); font-size:11px; font-weight:600; line-height:1.35; }
.referral-report .referral-card dd { margin:6px 0 0; color:var(--r-ink); font-size:17px; font-weight:760; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }

/* Empty + notes */
.referral-report .ref-empty { grid-column:1/-1; display:flex; flex-direction:column; align-items:center; gap:8px; padding:48px 20px; border:1px dashed #cfdae6; border-radius:18px; background:#ffffffb0; text-align:center; animation:refRise .6s var(--r-ease) both; }
.referral-report .ref-empty strong { color:var(--r-ink); font-size:16px; }
.referral-report .ref-empty span { color:var(--r-muted); font-size:13px; }
.referral-report .ref-note { margin:22px 0 0; padding:16px 18px; border:1px solid #cdeceb; border-radius:14px; background:linear-gradient(90deg,#e4f6f5,#f2fbfa); color:#0b5f68; animation:refRise .6s .5s var(--r-ease) both; }
.referral-report .ref-note p { margin:0; font-size:13px; line-height:1.65; }
.referral-report .ref-note p + p { margin-top:6px; }
.referral-report .ref-note small { color:#4f8a90; font-size:12px; }

@media(max-width:900px) { .referral-report .ref-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:560px) {
  .referral-report { padding:14px 14px 44px; }
  .referral-report .ref-hero { padding:18px 18px 22px; border-radius:18px; }
  .referral-report .ref-hero-body { align-items:flex-start; }
  .referral-report .ref-stat { padding:15px 14px 17px; }
  .referral-report .referral-card { padding:16px; }
  .referral-report .referral-card dd { font-size:16px; }
}
@media(prefers-reduced-motion:reduce) {
  .referral-report::before,.referral-report .ref-hero::before,.referral-report .ref-hero::after,.referral-report .ref-period i { animation:none !important; }
  .referral-report *,.referral-report *::before,.referral-report *::after { animation-duration:.001ms !important; animation-delay:0s !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}
