/* hyAffiliate V16 Blackhole Chroma: page-scoped visual tokens only. */
html body {
  --bg-deep:#030409; --bg-surface:#0a0e19; --bg-card:#101625;
  --bg-card-hover:#182039; --bg-input:rgba(255,255,255,.06);
  --bg-overlay:rgba(3,4,9,.94); --accent:#35eaff;
  --accent-text:#f5f8ff; --accent-dim:rgba(53,234,255,.12);
  --accent-glow:rgba(53,234,255,.24); --accent-hover:#8df4ff;
  --text:#f5f8ff; --text-dim:#b5c4d9; --muted:#9baac1;
  --border:rgba(132,158,205,.20); --border-focus:rgba(53,234,255,.55);
  --info:#35eaff; --purple:#9c6cff; --pink:#ff4fd8;
  --af-ink:#f5f8ff; --af-ink-dim:#9baac1;
  --af-glass:rgba(12,16,28,.86);
  --af-glass-border:rgba(132,158,205,.20);
  color-scheme:dark;
  background:radial-gradient(ellipse 60% 35% at 8% 0%,rgba(53,234,255,.10),transparent),radial-gradient(ellipse 55% 45% at 100% 0%,rgba(156,108,255,.13),transparent),#030409;
  color:#f5f8ff;
}
html body .card,html body .kpi {border-color:var(--af-glass-border);background:var(--af-glass)}
html body .topbar .brand,html body .card h2,html body .kpi .v {color:var(--accent)}
html body button:focus-visible,html body a:focus-visible,html body input:focus-visible {outline:2px solid #35eaff;outline-offset:2px}

/* V16 component layer: HyMail-inspired surfaces, Beautiful UI-style record/filter/selection patterns.
   Additive only: retains all legacy layout, event handlers, tenant filters and payout semantics. */
html body .wrap{max-width:1680px;margin-inline:auto;padding-inline:clamp(12px,2.2vw,32px)}
html body .topbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:12px;min-height:64px;padding:12px clamp(12px,2vw,24px);margin-bottom:20px;border:1px solid rgba(132,158,205,.18);border-radius:14px;background:rgba(6,11,20,.94);backdrop-filter:blur(18px);box-shadow:0 12px 32px rgba(0,0,0,.2)}
html body .topbar .brand{display:flex;align-items:center;gap:9px;font-size:17px;font-weight:750;letter-spacing:-.035em}
html body .screen>.card,html body .screen .card{border:1px solid rgba(132,158,205,.18);border-radius:16px;padding:clamp(14px,1.7vw,24px);background:linear-gradient(150deg,rgba(15,23,36,.96),rgba(7,12,21,.97));box-shadow:0 10px 30px rgba(0,0,0,.17)}
html body .screen .card h2{font-size:clamp(16px,1.4vw,20px);letter-spacing:-.03em;line-height:1.3}
html body .screen .kpi{border:1px solid rgba(132,158,205,.2);border-radius:14px;padding:16px;box-shadow:inset 0 1px 0 rgba(255,255,255,.035);background:rgba(16,26,42,.85)}
html body .screen .filter-row,html body .screen .lead-desk-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px;margin:12px 0 16px;border:1px solid rgba(132,158,205,.16);border-radius:12px;background:rgba(5,12,23,.72)}
html body .screen :is(input:not([type=checkbox]):not([type=radio]),select,textarea){min-height:38px;border:1px solid rgba(132,158,205,.26);border-radius:9px;background:rgba(5,11,21,.8);color:var(--text);padding:9px 12px;max-width:100%}
html body .screen :is(input,select,textarea):focus-visible{border-color:#35eaff;outline:2px solid rgba(53,234,255,.2);outline-offset:1px}
html body .screen .btn,html body .topbar .btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;border-radius:10px;padding:9px 14px;font-weight:650;transition:background .15s,border-color .15s,transform .15s}
html body .screen .btn:hover,html body .topbar .btn:hover{transform:translateY(-1px)}
html body .screen .scroll-x{border:1px solid rgba(132,158,205,.18);border-radius:12px;overflow:auto;background:rgba(5,10,18,.64)}
html body .screen table.tbl{width:100%;border-collapse:separate;border-spacing:0;font-variant-numeric:tabular-nums}
html body .screen table.tbl :is(th,td){padding:12px 14px;text-align:left;border-bottom:1px solid rgba(132,158,205,.13);vertical-align:middle}
html body .screen table.tbl th{position:sticky;top:0;background:#0e1726;color:#b5c4d9;font-size:11px;letter-spacing:.055em;text-transform:uppercase;z-index:2}
html body .screen table.tbl tbody tr:hover{background:rgba(53,234,255,.055)}
html body .screen table.tbl tbody tr:last-child td{border-bottom:0}
html body .screen :is(.actions-bar,.lead-desk-head){display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}
html body .screen :is(.lead-desk-detail,.lead-desk-list){min-width:0;border-radius:12px}
@media(max-width:720px){html body .wrap{padding-inline:8px}html body .topbar{border-radius:10px;flex-wrap:wrap}html body .screen .card{padding:12px}html body .screen .filter-row>*{flex:1 1 150px;min-width:0}html body .screen table.tbl :is(th,td){padding:10px}}
@media(prefers-reduced-motion:reduce){html body .screen .btn{transition:none!important;transform:none!important}}


/* V16.1 — polished, responsive blackhole chroma; existing business controls intact. */
html body .af-theme-btn{flex:0 0 auto;border:1px solid rgba(53,234,255,.44);border-radius:12px;min-width:44px;min-height:44px;background:rgba(53,234,255,.09);color:var(--accent);box-shadow:0 0 16px rgba(53,234,255,.16)}
html body .af-version{font:700 10px/1.2 system-ui;letter-spacing:.08em;color:var(--muted);white-space:nowrap}
html body .screen .card:hover{border-color:rgba(53,234,255,.44);box-shadow:0 0 0 1px rgba(53,234,255,.12),0 0 24px rgba(138,88,255,.13);transition:border-color .2s,box-shadow .2s}
html body .screen .card:focus-within{border-color:rgba(53,234,255,.65)}
html body .screen :is(.btn,.icon-btn,.style-chip,.admin-sub-btn){min-height:40px}
html body .screen :is(input,select,textarea){max-width:100%;min-width:0}
html body .screen :is(.pe-table,.scroll-x){overflow-x:auto;max-width:100%}
html[data-mode="light"] body{--bg-deep:#f3f7ff;--bg-surface:#fff;--bg-card:#fff;--bg-card-hover:#ebf2ff;--bg-input:#f3f7ff;--af-glass:rgba(255,255,255,.95);--af-glass-border:rgba(49,90,148,.16);--af-ink:#182943;--af-ink-dim:#51657d;--text:#182943;--text-dim:#51657d;--muted:#536982;--accent:#1477bc;--accent-dim:rgba(20,119,188,.09);--border:rgba(49,90,148,.19);--accent-text:#142947;color-scheme:light;background:#f3f7ff;color:#182943}
html[data-mode="light"] body .topbar{background:rgba(255,255,255,.96);border-color:rgba(49,90,148,.19)}
html[data-mode="light"] body .screen .card{background:linear-gradient(150deg,#fff,#f7faff);box-shadow:0 10px 30px rgba(34,66,110,.07)}
html[data-mode="light"] body .screen .kpi,html[data-mode="light"] body .screen .filter-row{background:#f7faff}
@media(max-width:720px){html body .wrap{padding-inline:12px!important}html body .topbar{gap:8px;padding:10px;border-radius:12px;flex-wrap:wrap}html body .topbar .brand{font-size:15px}html body .screen .card{padding:14px!important;border-radius:13px}html body .screen .filter-row{padding:10px}html body .screen .filter-row>*{flex:1 1 145px}html body .screen .kpi{min-width:0}html body .af-version{font-size:9px}}
@media(max-width:390px){html body .topbar .brand-label{font-size:14px}html body .af-version{display:none}html body .screen .card{padding:12px!important}}
@media(prefers-reduced-motion:reduce){html body .screen .card{transition:none!important}}


/* V16.4 — accessible LIGHT mode overrides for inherited V11 dark surfaces. */
html[data-mode="light"] body .screen .scroll-x,
html[data-mode="light"] body .screen .lead-desk-list,
html[data-mode="light"] body .screen .lead-desk-detail{
 background:#ffffff!important;color:#1c304e!important;
 border-color:rgba(55,88,135,.19)!important;
}
html[data-mode="light"] body .screen table.tbl{background:#ffffff!important;color:#1c304e!important}
html[data-mode="light"] body .screen table.tbl thead,
html[data-mode="light"] body .screen table.tbl th{
 background:#eaf1fc!important;color:#294565!important;
 border-color:#cbd9eb!important;
}
html[data-mode="light"] body .screen table.tbl tbody,
html[data-mode="light"] body .screen table.tbl tbody tr,
html[data-mode="light"] body .screen table.tbl tbody td{
 background:#ffffff!important;color:#253b5b!important;opacity:1!important;
 border-color:#e0e9f5!important;
}
html[data-mode="light"] body .screen table.tbl tbody tr:nth-child(even),
html[data-mode="light"] body .screen table.tbl tbody tr:nth-child(even) td{background:#f4f8fe!important}
html[data-mode="light"] body .screen table.tbl tbody tr:hover,
html[data-mode="light"] body .screen table.tbl tbody tr:hover td{background:#e8f4ff!important}
html[data-mode="light"] body .screen table.tbl :is(a,button,.btn){opacity:1;color:#126ca9}
html[data-mode="light"] body .screen :is(input:not([type=checkbox]),select,textarea){
 background:#ffffff!important;color:#1c304e!important;border-color:#b6c9e4!important;
}
html[data-mode="light"] body .screen :is(input,textarea)::placeholder{color:#667d98!important;opacity:1}
html[data-mode="light"] body .screen :is(.btn.ghost,.pe-tab,.icon-btn){background:#f6faff!important;color:#225178!important;border:1px solid #cbd8e9!important}
html[data-mode="light"] body .screen :is(.pe-tab.active,.btn.active){background:#dceeff!important;color:#095e9a!important;border-color:#64aee2!important}
html[data-mode="light"] body .screen .muted{color:#5f728e!important}
html[data-mode="light"] body .screen :is(.pe-stat,.note,.pe-workspace-note){background:#f7faff;color:#233a56;border-color:#d2deee}
html[data-mode="light"] body .screen :is(.badge,.pill){opacity:1}
@media(max-width:640px){
 html[data-mode="light"] body .screen table.tbl :is(th,td){padding:10px!important}
 html[data-mode="light"] body .screen .scroll-x{max-width:100%;overflow-x:auto}
}

/* V16.5 — true profile drop-down, works on all breakpoints */
.af-account-wrap{position:relative;flex:0 0 auto}
#af-account-btn{min-width:44px;min-height:44px;border:1px solid rgba(53,234,255,.35);border-radius:12px;background:rgba(53,234,255,.08)}
.af-account-menu{position:absolute;right:0;top:calc(100% + 9px);width:min(240px,calc(100vw - 28px));padding:8px;border-radius:14px;background:#101c31;color:#edf4ff;border:1px solid rgba(53,234,255,.35);box-shadow:0 20px 55px rgba(0,0,0,.35);z-index:200}
.af-account-menu[hidden]{display:none!important}
.af-account-menu :is(button,a){width:100%;min-height:44px;text-align:left;padding:11px 13px;border:0;border-radius:9px;background:transparent;color:inherit;display:flex;gap:10px;align-items:center;text-decoration:none;font:600 13px system-ui;cursor:pointer}
.af-account-menu :is(button,a):hover{background:rgba(53,234,255,.10)}
html[data-mode="light"] .af-account-menu{background:#fff;color:#213d60;border-color:#bfdaed;box-shadow:0 16px 35px rgba(26,65,111,.17)}
html[data-mode="light"] #af-account-btn{color:#126ba9;background:#f0f9ff}


/* V16.6 — real finance Home, stable Coupon Center title, responsive actions. */
.af-recon-home{position:relative;min-width:0;border-radius:18px}
.af-home-heading{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-start;justify-content:space-between}
.af-home-heading h2,.af-coupon-heading h2{font-size:clamp(23px,3vw,36px);line-height:1.1;letter-spacing:-.045em;margin:7px 0 9px;color:var(--text);font-weight:850}
.af-home-glow,.af-coupon-heading h2 span{background:linear-gradient(95deg,#35eaff,#7388ff,#c25aff);background-clip:text;-webkit-background-clip:text;color:transparent}
.af-coupon-heading{padding:9px 4px 20px;border-bottom:1px solid var(--border);margin-bottom:16px}
.af-recon-home .hcm-eyebrow,.af-coupon-heading .hcm-eyebrow{font-size:10px;letter-spacing:.18em;font-weight:800;color:#35d9ed}
.af-home-controls{display:flex;align-items:end;flex-wrap:wrap;gap:12px;margin-top:16px}
.af-home-controls label,.af-recon-home form label{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:700;letter-spacing:.02em;color:var(--muted)}
.af-home-controls select,.af-recon-home form :is(input,textarea){min-height:43px;min-width:180px;padding:9px 12px;border-radius:11px;border:1px solid var(--border);background:var(--bg-surface);color:var(--text)}
.af-recon-home form{display:grid;gap:12px;margin-top:14px}
.af-recon-home form :is(input,textarea){width:100%;min-width:0}
.af-recon-enabled{display:flex;gap:10px;align-items:center;padding:12px;border:1px solid rgba(53,234,255,.27);border-radius:11px;color:var(--muted);font-size:12px}
.af-recon-enabled strong{color:#4dded7}
.af-recon-code{width:min(175px,100%);min-width:0;border:1px solid var(--border);border-radius:9px;padding:9px;background:var(--bg-surface);color:var(--text)}
.af-home-columns{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:14px}
.af-home-columns>*{min-width:0}
.af-recon-home .scroll-x{max-width:100%;overflow-x:auto}
.af-recon-home .pager{display:flex;justify-content:flex-end;gap:12px;align-items:center;padding:12px 0}
.af-recon-home .pager button{min-height:40px;padding:8px 13px}
html[data-mode="light"] .af-recon-home .scroll-x,
html[data-mode="light"] .af-recon-home :is(.af-recon-code,select,input,textarea){background:#fff!important;color:#203753!important}
html[data-mode="light"] .af-recon-home .af-recon-enabled strong{color:#136a9d}
@media(max-width:900px){.af-home-columns{grid-template-columns:minmax(0,1fr)}}
@media(max-width:570px){.af-home-heading{flex-direction:column}.af-home-controls>label{flex:1 1 100%}.af-home-controls select{width:100%}.af-recon-home{padding:13px!important}.af-recon-home .scroll-x table{min-width:600px}}
