/* FX KINGDOM — SINGLE SOURCE OF TRUTH FOR BRAND COLORS
   -------------------------------------------------------
   Rebrand a cloned project by changing ONLY the tokens in :root below.
   All web/member/admin layouts load this file; selectors below cover
   legacy pages whose original styles still have embedded blue values.
   Keep --theme-success and --theme-danger distinct for transaction status.
*/
:root {
    --theme-bg: #050505;
    --theme-bg-rgb: 5, 5, 5;
    --theme-panel: #100e0b;
    --theme-panel-rgb: 16, 14, 11;
    --theme-panel-raised: #19150f;
    --theme-input: #080807;
    --theme-input-icon: #1a150d;
    --theme-primary: #d4a83c;
    --theme-primary-light: #ffdb7d;
    --theme-primary-rgb: 212, 168, 60;
    --theme-line: #665023;
    --theme-line-soft: rgba(var(--theme-primary-rgb), .28);
    --theme-text: #f7f0e2;
    --theme-muted: #b9a17c;
    --theme-on-primary: #1a1106;
    --theme-success: #38dc97;
    --theme-danger: #ff5577;

    /* Compatibility bridge: legacy --fx-* and --t20-* rules */
    --fx-gold: var(--theme-primary);
    --fx-gold-soft: var(--theme-primary-light);
    --fx-gold-deep: var(--theme-primary);
    --fx-line: var(--theme-line-soft);
    --fx-line-strong: var(--theme-line);
    --fx-text: var(--theme-text);
    --fx-muted: var(--theme-muted);
    --fx-bg: var(--theme-bg);
    --fx-surface: var(--theme-panel);
    --fx-surface-2: var(--theme-panel-raised);
    --fx-surface-3: var(--theme-panel-raised);
    --t20-bg: var(--theme-bg);
    --t20-bg2: var(--theme-panel);
    --t20-panel: var(--theme-panel);
    --t20-panel2: var(--theme-panel-raised);
    --t20-line: var(--theme-line);
    --t20-text: var(--theme-text);
    --t20-muted: var(--theme-muted);
    --t20-blue: var(--theme-primary);
    --t20-cyan: var(--theme-primary-light);
    --t20-gold: var(--theme-primary);
}

/* The member shell, input and form accent controls. */
body.app-shell.member-theme {
    background: var(--theme-bg) !important;
    color: var(--theme-text) !important;
}
body.app-shell.member-theme .page-wrap,
body.app-shell.member-theme .content { background: var(--theme-bg) !important; }
body.app-shell.member-theme .sidebar,
body.app-shell.member-theme .app-topbar {
    background: var(--theme-bg) !important;
    border-color: var(--theme-line-soft) !important;
}
body.app-shell.member-theme .field-label .field-icon,
body.app-shell.member-theme .input-icon,
body.app-shell.member-theme .form-icon,
body.app-shell.member-theme .filter-icon,
body.app-shell.member-theme .field-shell > span:first-child,
body.app-shell.member-theme .input-shell > span:first-child,
body.app-shell.member-theme .input-group > span:first-child {
    background: var(--theme-input-icon) !important;
    background-image: none !important;
    color: var(--theme-primary-light) !important;
    border-color: var(--theme-line-soft) !important;
    box-shadow: none !important;
}
body.app-shell.member-theme .content :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea),
body.app-shell.member-theme .content :is(.input-shell, .field-shell, .input-group, .country-search-wrap) {
    background: var(--theme-input) !important;
    background-image: none !important;
    border-color: var(--theme-line-soft) !important;
    color: var(--theme-text) !important;
}
body.app-shell.member-theme .content input:focus,
body.app-shell.member-theme .content select:focus,
body.app-shell.member-theme .content textarea:focus {
    outline-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), .12) !important;
}
body.app-shell.member-theme .content ::placeholder {color: var(--theme-muted) !important;opacity:.85;}
body.app-shell.member-theme .content :is(.card,.panel,.stat),
body.app-shell.member-theme .content form:not(.inline-form):not(.tree-depth-form) {
    background-color: var(--theme-panel) !important;
    border-color: var(--theme-line-soft) !important;
}

/* Registration: applies both within the member shell and before login. */
.registration-page .registration-shell {
    background: var(--theme-panel) !important;
    border-color: var(--theme-line-soft) !important;
}
.registration-page .registration-brand {
    background: linear-gradient(145deg,var(--theme-panel-raised),var(--theme-bg)) !important;
    border-color: var(--theme-line-soft) !important;
}
.registration-page .registration-card {
    background: var(--theme-bg) !important;
    border-color: var(--theme-line-soft) !important;
}
.registration-page :is(.reg-trust span,.public-sponsor-note,.country-search-dropdown,.country-option:hover,.country-option:focus,.t20-credential-grid div,.t20-success-card) {
    background: var(--theme-panel) !important;
    border-color: var(--theme-line-soft) !important;
}
.registration-page .field-label > span:first-child,
.registration-page .public-sponsor-note-icon,
.registration-page .field-icon {
    background: var(--theme-input-icon) !important;
    color: var(--theme-primary-light) !important;
    border-color: var(--theme-line-soft) !important;
}
.registration-page :is(input:not([type=checkbox]):not([type=hidden]),select,textarea,.country-search-input,.placement-locked-input),
.registration-page :is(.input-shell,.country-search-wrap) {
    background: var(--theme-input) !important;
    border-color: var(--theme-line-soft) !important;
    color: var(--theme-text) !important;
}
.registration-page :is(input, select,textarea):focus {
    border-color: var(--theme-primary) !important;
    outline-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb),.12) !important;
}
.registration-page .country-option { color:var(--theme-text) !important; }
.registration-page .reg-trust span {color:var(--theme-text) !important;}
.registration-page .registration-brand p,
.registration-page .registration-card .page-title p {color:var(--theme-muted) !important;}
.registration-page .t20-success-card {background:var(--theme-panel) !important;}

/* Placement and sponsor tree (including tooltip and tree filters). */
body.app-shell.member-theme .tree-page :is(.tree-toolbar,.tree-stage-shell,.tree-note,.tree-tooltip),
body.app-shell.member-theme .tree-tooltip {
    background: var(--theme-panel) !important;
    background-image: none !important;
    border-color: var(--theme-line-soft) !important;
    color: var(--theme-text) !important;
}
body.app-shell.member-theme .tree-page :is(.tree-input-wrap,.tree-input-wrap input,.tree-tools input),
body.app-shell.member-theme .tree-page .tree-input-wrap span,
body.app-shell.member-theme .tree-page .tree-tools button,
body.app-shell.member-theme .tree-page .tree-home-btn {
    background: var(--theme-input) !important;
    background-image: none !important;
    border-color: var(--theme-line-soft) !important;
    color: var(--theme-primary-light) !important;
    box-shadow: none !important;
}
body.app-shell.member-theme .tree-page .tree-input-wrap span {background:var(--theme-input-icon) !important;}
body.app-shell.member-theme .tree-page .tree-btn:not(.tree-home-btn) {
    background: linear-gradient(180deg,var(--theme-primary-light),var(--theme-primary)) !important;
    color: var(--theme-on-primary) !important;
    border-color: var(--theme-primary) !important;
    box-shadow: 0 7px 17px rgba(var(--theme-primary-rgb),.17) !important;
}
body.app-shell.member-theme .tree-page :is(.tree-node,.binary-empty,.sponsor-join),
body.app-shell.member-theme .tree-tooltip .tt-head img {
    background: var(--theme-panel) !important;
    background-image: none !important;
}
body.app-shell.member-theme .tree-page :is(.binary-empty,.sponsor-join),
body.app-shell.member-theme .tree-tooltip .tt-head img {
    border-color: var(--theme-line-soft) !important;
}
body.app-shell.member-theme .tree-page :is(.binary-side,.root-label,.tree-kicker),
body.app-shell.member-theme .tree-tooltip .tt-business b {color:var(--theme-primary-light) !important;}
body.app-shell.member-theme .tree-page :is(.tree-head p,.tree-legend,.tree-node small,.sponsor-join small,.binary-empty small,.tree-note),
body.app-shell.member-theme .tree-tooltip :is(.tt-grid small,.tt-head small) {
    color:var(--theme-muted) !important;
}
body.app-shell.member-theme .tree-page :is(.tree-node:hover,.tree-node.is-search-hit) {
    border-color:var(--theme-primary) !important;
    box-shadow: 0 0 0 2px rgba(var(--theme-primary-rgb),.15) !important;
}
body.app-shell.member-theme .tree-page :is(.tree-tools button:hover,.tree-home-btn:hover) {
    background:var(--theme-panel-raised) !important;
    border-color:var(--theme-primary) !important;
}
/* Do NOT change the active / inactive red and green nodes. */

/* Lists, filters, wallets, transactions and newly added member pages. */
body.app-shell.member-theme .content :is(.field-shell,.downline-table-head div,.addr-box code,.dep-grid input,.verify input,.v2-link-box,.filter-card,.filter-bar,.search-box,.t20-success-card),
body.app-shell.member-theme .content :is(.country-search-dropdown,.country-option:hover,.country-option:focus) {
    background:var(--theme-panel) !important;
    background-image:none !important;
    border-color:var(--theme-line-soft) !important;
}
body.app-shell.member-theme .content :is(.filter-icon,.t20-filter-btn.secondary,.field-shell .filter-icon) {
    background:var(--theme-input-icon) !important;
    color:var(--theme-primary-light) !important;
    border-color:var(--theme-line-soft) !important;
}
body.app-shell.member-theme .content :is(.t20-filter-btn:not(.secondary),.v2-link-box button,.tree-btn:not(.tree-home-btn)) {
    background:linear-gradient(180deg,var(--theme-primary-light),var(--theme-primary)) !important;
    border-color:var(--theme-primary) !important;
    color:var(--theme-on-primary) !important;
    box-shadow:none !important;
}
body.app-shell.member-theme .content :is(.v2-icon.blue,.v2-icon.cyan) {
    background:var(--theme-input-icon) !important;
    border-color:var(--theme-line-soft) !important;
    color:var(--theme-primary-light) !important;
}
body.app-shell.member-theme .content .downline-table-head strong {color:var(--theme-muted) !important;}
body.app-shell.member-theme .content :is(.wallet-card,.dashboard-card,.v2-network-card,.v2-sponsor-panel) {
    border-color:var(--theme-line-soft) !important;
}

/* Reusable login & forgotten password, including stand-alone routes. */
body.member-login-page .member-input-icon,
body.member-login-page .member-dark-input {
    background:var(--theme-input-icon) !important;
    border-color:var(--theme-line-soft) !important;
    color:var(--theme-primary-light) !important;
}
body.member-login-page .member-dark-input input {background:var(--theme-input) !important;color:var(--theme-text) !important;}
body:has(.fp-wrap) .fp-wrap {background:var(--theme-bg) !important;}
body:has(.fp-wrap) .fp-card {background:var(--theme-panel) !important;border-color:var(--theme-line-soft) !important;}
body:has(.fp-wrap) .fp-input {background:var(--theme-input) !important;border-color:var(--theme-line-soft) !important;color:var(--theme-text) !important;}
body:has(.fp-wrap) .fp-btn {background:linear-gradient(180deg,var(--theme-primary-light),var(--theme-primary)) !important;color:var(--theme-on-primary) !important;}

/* Admin shell: visual tokens only; existing permissions & controls intact. */
body.admin-theme :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
    background:var(--theme-input) !important;border-color:var(--theme-line-soft) !important;color:var(--theme-text) !important;
}
body.admin-theme :is(input,select,textarea):focus {border-color:var(--theme-primary) !important;outline-color:var(--theme-primary) !important;}
body.admin-theme .field-icon {background:var(--theme-input-icon) !important;color:var(--theme-primary-light) !important;border-color:var(--theme-line-soft) !important;}

/* Responsive: don't change existing layout grids or sidebar behavior. */
@media(max-width: 900px) {
    .registration-page .registration-brand {border-right:0 !important;border-bottom:1px solid var(--theme-line-soft) !important;}
    body.app-shell.member-theme .tree-page .tree-toolbar {max-width:100%;}
}

/* Public footer: original circular crown logo (no white disk / cropping). */
.footer .footer-brand .fx-footer-logo {
    display:block;width:94px;height:94px;object-fit:contain;object-position:center;
    border-radius:50%;background:var(--theme-bg);border:1px solid var(--theme-line);
    margin:0 0 12px;box-shadow:0 5px 16px rgba(0,0,0,.25);
}
.footer .footer-grid a[href^="mailto:"],
.footer .footer-grid a[href^="https://www.fxkingdomzzn.com"] {
    display:block;overflow-wrap:anywhere;
}


/* PHASE 2 / COMMON INPUT CONTROLS: site.js builds .t20-control-shell and
   .t20-input-icon on registration, edit profile, security, crypto and other forms.
   This block deliberately lives in the CENTRAL brand theme stylesheet so a
   future rebrand changes tokens here rather than per-page source files. */
body.app-shell.member-theme .content .t20-control-shell,
body.app-shell.member-theme .registration-page .t20-control-shell,
body.app-shell.member-theme .registration-card .t20-control-shell,
.registration-page .t20-control-shell,
body.admin-theme .content .t20-control-shell {
    background: var(--theme-input) !important;
    background-image: none !important;
    border: 1px solid var(--theme-line-soft) !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,.22) !important;
}
body.app-shell.member-theme .content .t20-control-shell .t20-input-icon,
body.app-shell.member-theme .registration-page .t20-control-shell .t20-input-icon,
body.app-shell.member-theme .registration-card .t20-control-shell .t20-input-icon,
.registration-page .t20-control-shell .t20-input-icon,
body.admin-theme .content .t20-control-shell .t20-input-icon {
    background: var(--theme-input-icon) !important;
    background-color: var(--theme-input-icon) !important;
    background-image: none !important;
    color: var(--theme-primary-light) !important;
    border-color: var(--theme-line-soft) !important;
    box-shadow: none !important;
}
body.app-shell.member-theme .content .t20-control-shell .t20-input-icon svg,
body.app-shell.member-theme .registration-page .t20-control-shell .t20-input-icon svg,
.registration-page .t20-control-shell .t20-input-icon svg,
body.admin-theme .content .t20-control-shell .t20-input-icon svg {
    color: var(--theme-primary-light) !important;
    stroke: currentColor !important;
}
body.app-shell.member-theme .content .t20-control-shell :is(input,select,textarea),
body.app-shell.member-theme .registration-page .t20-control-shell :is(input,select,textarea),
.registration-page .t20-control-shell :is(input,select,textarea),
body.admin-theme .content .t20-control-shell :is(input,select,textarea) {
    background: var(--theme-input) !important;
    background-image: none !important;
    color: var(--theme-text) !important;
    border: 0 !important;
    box-shadow: none !important;
}
body.app-shell.member-theme .content .t20-control-shell:focus-within,
.registration-page .t20-control-shell:focus-within,
body.admin-theme .content .t20-control-shell:focus-within {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), .12) !important;
}
/* Never recolor success/error indicators or disabled controls to gold. */


/* ==============================================================
   PHASE 4: ADMIN + MEMBER SHARE A SINGLE COLOR TOKEN PALETTE
   Only change :root tokens at top of this file for future brands.
   Legacy admin/page styles still exist for geometry; these
   centralized overrides win on paint, including inline CSS.
   ============================================================== */
body.app-shell.admin-theme {
    background: var(--theme-bg) !important;
    color: var(--theme-text) !important;
}
body.admin-theme .sidebar,
body.admin-theme .page-wrap,
body.admin-theme .content,
body.admin-theme .app-topbar {
    background: var(--theme-bg) !important;
    background-image: none !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-line-soft) !important;
}
body.admin-theme .sidebar {box-shadow: 12px 0 28px rgba(0,0,0,.33) !important;}
body.admin-theme .app-topbar {background: var(--theme-panel) !important;}
body.admin-theme .topbar-title span,
body.admin-theme .user-chip b,
body.admin-theme :is(h1,h2,h3,h4),
body.admin-theme .t20-fund-card strong {color:var(--theme-text) !important;}
body.admin-theme .topbar-title small,
body.admin-theme .user-chip small,
body.admin-theme .t20-fund-card :is(small,span),
body.admin-theme .t20-fund-head p {color:var(--theme-muted) !important;}
body.admin-theme .user-chip,
body.admin-theme .nav-groups .submenu,
body.admin-theme .content :is(.panel,.card,.stat,.filter-card,.form-card,.table-wrap,.table-scroll,.data-table),
body.admin-theme .content form:not(.inline-form),
body.admin-theme .t20-fund-card,
body.admin-theme .t20-fund-note {
    background: var(--theme-panel) !important;
    background-image: none !important;
    color:var(--theme-text) !important;
    border-color:var(--theme-line-soft) !important;
}
body.admin-theme .content :is(.t20-fund-grid,.stats,.cards) {max-width:100%;}
body.admin-theme .t20-fund-card:before{background:var(--theme-primary) !important;}
body.admin-theme .t20-fund-card.success:before{background:var(--theme-success) !important;}
body.admin-theme .t20-fund-card.danger:before{background:var(--theme-danger) !important;}
body.admin-theme .t20-fund-card.warn:before{background:var(--theme-primary-light) !important;}
body.admin-theme .t20-fund-card.cyan:before,
body.admin-theme .t20-fund-card.purple:before,
body.admin-theme .t20-fund-card.gold:before{background:var(--theme-primary) !important;}
body.admin-theme .brand-wrap-logo {
    width:176px !important;height:176px !important;min-height:176px !important;
    margin:10px auto 18px !important;padding:0 !important;
    display:flex !important;align-items:center !important;justify-content:center !important;
    border-radius:50% !important;overflow:hidden !important;
    background:var(--theme-bg) !important;
    border:1px solid var(--theme-line-soft) !important;
    box-shadow:0 11px 25px rgba(0,0,0,.38) !important;
}
body.admin-theme .brand-wrap-logo .sidebar-logo {
    display:block !important;width:100% !important;height:100% !important;
    max-width:none !important;object-fit:contain !important;
    border-radius:50% !important;filter:none !important;
    transform:none !important;
}
body.admin-theme .nav-groups :is(a.nav-link,summary,.admin-nav-static) {
    color:var(--theme-text) !important;
    border:1px solid transparent !important;
}
body.admin-theme .nav-groups :is(a.nav-link:hover,summary:hover,details[open]>summary) {
    background:var(--theme-panel-raised) !important;
    background-image:none !important;
    color:var(--theme-primary-light) !important;
    border-color:var(--theme-line-soft) !important;
}
body.admin-theme .nav-groups .admin-nav-static {
    display:flex;align-items:center;gap:12px;padding:12px 13px;
    margin:3px 0;border-radius:12px;
    background:var(--theme-panel) !important;
    cursor:default !important;user-select:none;
    pointer-events:none;
    font-weight:700;
}
body.admin-theme .nav-groups .submenu a {color:var(--theme-muted) !important;}
body.admin-theme .nav-groups .submenu a:hover {color:var(--theme-primary-light) !important;background:var(--theme-panel-raised) !important;}
body.admin-theme .user-chip .avatar {
    background:linear-gradient(180deg,var(--theme-primary-light),var(--theme-primary)) !important;
    color:var(--theme-on-primary) !important;
}
body.admin-theme .content :is(input:not([type=checkbox]):not([type=radio]),select,textarea),
body.admin-theme .content :is(.input-shell,.admin-input-shell,.field-shell,.input-group) {
    background:var(--theme-input) !important;
    background-image:none !important;
    color:var(--theme-text) !important;
    border-color:var(--theme-line-soft) !important;
}
body.admin-theme .content :is(input,select,textarea):focus {
    border-color:var(--theme-primary) !important;
    outline-color:var(--theme-primary) !important;
    box-shadow:0 0 0 3px rgba(var(--theme-primary-rgb),.10) !important;
}
body.admin-theme .content :is(.input-icon,.field-icon,.t20-input-icon,.admin-input-icon) {
    background:var(--theme-input-icon) !important;
    color:var(--theme-primary-light) !important;
    border-color:var(--theme-line-soft) !important;
}
body.admin-theme .content ::placeholder {color:var(--theme-muted) !important;opacity:.85;}
body.admin-theme .content :is(.panel,table) th,
body.admin-theme .content :is(.data-table,table) thead th {
    background:var(--theme-panel-raised) !important;
    color:var(--theme-primary-light) !important;
    border-color:var(--theme-line-soft) !important;
}
body.admin-theme .content :is(table,.data-table,.table-wrap,tbody,tr,td) {
    border-color:var(--theme-line-soft) !important;
}
body.admin-theme .content :is(table,.data-table) {background:var(--theme-panel) !important;}
body.admin-theme .content :is(table,.data-table) td {color:var(--theme-text) !important;}
body.admin-theme .content :is(table,.data-table) tbody tr:hover {background:var(--theme-panel-raised) !important;}
body.admin-theme :is(.btn,.action-btn,.logout-btn,.grid-export,button[type=submit]):not(.btn-danger):not(.danger):not(.admin-sidebar-backdrop),
body.admin-theme .sidebar-footer .logout-btn {
    background:linear-gradient(180deg,var(--theme-primary-light),var(--theme-primary)) !important;
    border-color:var(--theme-primary) !important;
    color:var(--theme-on-primary) !important;
}
body.admin-theme :is(.btn-danger,.danger) {background:#6c1f2d !important;color:#fff !important;border-color:var(--theme-danger) !important;}
body.admin-theme :is(button,input,select,textarea,a):focus-visible {outline:2px solid var(--theme-primary-light);outline-offset:2px;}
body.admin-theme .menu-toggle {
    background:var(--theme-panel-raised) !important;
    color:var(--theme-primary-light) !important;
    border:1px solid var(--theme-line-soft) !important;
}
body.admin-theme .admin-sidebar-backdrop {display:none;}
/* Existing site.css gives min-width to tables; keep them in a scrollable content area. */
body.admin-theme .content {min-width:0;overflow-x:auto;}
body.admin-theme .content :is(.table-wrap,.table-scroll){max-width:100%;overflow-x:auto !important;}
body.admin-theme .t20-fund-grid {grid-template-columns:repeat(4,minmax(0,1fr));}

/* The two stand-alone Admin security screens; exact same palette. */
body.fx-admin-login,body.fx-admin-pin {
    color:var(--theme-text) !important;
    background:var(--theme-bg) !important;
}
body.fx-admin-login .admin-login-page,
body.fx-admin-pin .pin-page {
    background:linear-gradient(110deg,var(--theme-panel),var(--theme-bg)) !important;
    background-image:linear-gradient(110deg,var(--theme-panel),var(--theme-bg)) !important;
}
body.fx-admin-login :is(.admin-brand-panel,.admin-login-side),
body.fx-admin-pin :is(.brand-panel,.pin-side) {
    background:var(--theme-bg) !important;
    background-image:none !important;
    border-color:var(--theme-line-soft) !important;
}
body.fx-admin-login .admin-brand-panel::before,
body.fx-admin-pin .brand-panel::before {border-color:var(--theme-line-soft) !important;}
body.fx-admin-login .admin-brand-panel::after,
body.fx-admin-pin .brand-panel::after {
    background:radial-gradient(circle,rgba(var(--theme-primary-rgb),.10),transparent 72%) !important;
}
body.fx-admin-login .admin-main-logo,
body.fx-admin-pin .main-logo {
    width:min(330px,78%) !important;height:min(330px,78vw) !important;
    aspect-ratio:1;object-fit:contain !important;
    border-radius:50% !important;
    filter:drop-shadow(0 14px 27px rgba(0,0,0,.55)) !important;
}
body.fx-admin-login :is(.admin-login-card,.admin-feature),
body.fx-admin-pin :is(.pin-card,.feature) {
    background:var(--theme-panel) !important;
    background-image:none !important;
    border-color:var(--theme-line-soft) !important;
    color:var(--theme-text) !important;
}
body.fx-admin-login :is(.admin-welcome,.admin-feature .ico,.admin-secure-note span),
body.fx-admin-pin :is(.step,.feature .ico) {color:var(--theme-primary-light) !important;}
body.fx-admin-login :is(.admin-login-card h1,.admin-feature strong,.admin-field-label),
body.fx-admin-pin :is(.pin-card h1,.feature strong,.label) {color:var(--theme-text) !important;}
body.fx-admin-login :is(.admin-login-subtitle,.admin-feature span,.admin-secure-note,.admin-remember),
body.fx-admin-pin :is(.subtitle,.feature span,.hint,.secure-note) {color:var(--theme-muted) !important;}
body.fx-admin-login .admin-input-shell,
body.fx-admin-pin .input-shell {
    background:var(--theme-input) !important;
    border-color:var(--theme-line-soft) !important;
}
body.fx-admin-login .admin-input-shell:focus-within,
body.fx-admin-pin .input-shell:focus-within {
    border-color:var(--theme-primary) !important;
    box-shadow:0 0 0 3px rgba(var(--theme-primary-rgb),.12) !important;
}
body.fx-admin-login .admin-input-icon,
body.fx-admin-pin .input-icon {
    background:var(--theme-input-icon) !important;
    color:var(--theme-primary-light) !important;
    border-color:var(--theme-line-soft) !important;
}
body.fx-admin-login .admin-input-shell input,
body.fx-admin-pin .input-shell input {
    background:var(--theme-input) !important;
    color:var(--theme-text) !important;
    caret-color:var(--theme-primary-light) !important;
}
body.fx-admin-login .admin-input-shell input:-webkit-autofill {
    -webkit-text-fill-color:var(--theme-text) !important;
    -webkit-box-shadow:0 0 0 1000px var(--theme-input) inset !important;
}
body.fx-admin-login .admin-input-shell input::placeholder,
body.fx-admin-pin .input-shell input::placeholder{color:var(--theme-muted) !important;}
body.fx-admin-login .admin-login-btn,
body.fx-admin-pin .verify-btn {
    background:linear-gradient(180deg,var(--theme-primary-light),var(--theme-primary)) !important;
    color:var(--theme-on-primary) !important;
    border-color:var(--theme-primary-light) !important;
    box-shadow:0 10px 28px rgba(var(--theme-primary-rgb),.15) !important;
}
body.fx-admin-login .admin-remember input {accent-color:var(--theme-primary) !important;}
body.fx-admin-pin .logout-btn {color:var(--theme-primary-light) !important;}
/* Keep dangerous errors pink/red and success feedback green. */

@media (max-width:1150px) {
    body.admin-theme .t20-fund-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:1050px) {
    body.admin-theme .sidebar {
        position:fixed !important;inset:0 auto 0 0 !important;
        width:min(84vw,286px) !important;
        height:100dvh !important;overflow-y:auto !important;
        z-index:1001 !important;
        transform:translateX(-105%) !important;
        transition:transform .2s ease !important;
    }
    body.admin-theme.sidebar-open .sidebar {transform:translateX(0) !important;}
    body.admin-theme .page-wrap {margin-left:0 !important;width:100% !important;min-width:0;}
    body.admin-theme .app-topbar {padding:0 16px !important;}
    body.admin-theme .menu-toggle {display:inline-flex !important;align-items:center;justify-content:center;}
    body.admin-theme.sidebar-open .admin-sidebar-backdrop {
        display:block !important;
        position:fixed !important;inset:0 !important;z-index:1000 !important;
        background:rgba(0,0,0,.68) !important;
        border:0 !important;padding:0 !important;
        cursor:pointer !important;
    }
    body.admin-theme .brand-wrap-logo {width:138px !important;height:138px !important;min-height:138px !important;}
}
@media (max-width:820px) {
    body.fx-admin-login,body.fx-admin-pin {overflow:auto !important;}
    body.fx-admin-login .admin-login-page,body.fx-admin-pin .pin-page {
        display:flex !important;flex-direction:column !important;
        min-height:100dvh !important;height:auto !important;
        width:100% !important;
    }
    body.fx-admin-login .admin-brand-panel,body.fx-admin-pin .brand-panel {
        min-height:0 !important;padding:24px 18px 16px !important;
    }
    body.fx-admin-login .admin-logo-wrap,body.fx-admin-pin .logo-wrap {
        height:auto !important;min-height:180px !important;margin:0 auto !important;
    }
    body.fx-admin-login .admin-main-logo,body.fx-admin-pin .main-logo {
        width:min(230px,58vw) !important;height:min(230px,58vw) !important;
    }
    body.fx-admin-login .admin-feature-row,body.fx-admin-pin .feature-row {margin:18px auto 0 !important;gap:8px !important;}
    body.fx-admin-login .admin-login-side,body.fx-admin-pin .pin-side {
        min-height:0 !important;padding:20px 14px 30px !important;
    }
    body.fx-admin-login .admin-login-card,body.fx-admin-pin .pin-card {padding:25px 19px !important;}
}
@media (max-width:620px) {
    body.admin-theme .app-topbar {height:66px !important;}
    body.admin-theme .content {padding:16px 12px 38px !important;}
    body.admin-theme .user-chip {max-width:49%;min-width:0;overflow:hidden;}
    body.admin-theme .user-chip b {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
    body.admin-theme .t20-fund-grid {grid-template-columns:1fr !important;}
    body.admin-theme .t20-fund-card {min-height:110px !important;padding:15px !important;}
    body.admin-theme .t20-fund-head {align-items:flex-start !important;}
    body.admin-theme .content .filter-row > * {width:100% !important;min-width:0 !important;}
    body.admin-theme .content form input:not([type=checkbox]):not([type=radio]),
    body.admin-theme .content form select,
    body.admin-theme .content form textarea{max-width:100%;}
}

/* PHASE 5: ADMIN FORM SURFACE — FIX BLUE LEGACY OVERLAY
   The existing site.css contains the extra-specific rule:
   .app-shell .content form:not(.inline-form):not(.sidebar-footer form)
   which paints the form navy with !important. Match that selector's
   specificity (and add admin-theme) so all current and future admin
   forms follow the SAME central brand color tokens without touching
   transactional views or the base site.css.
*/
body.app-shell.admin-theme .content form:not(.inline-form):not(.sidebar-footer form) {
    background: var(--theme-panel) !important;
    background-image: none !important;
    border: 1px solid var(--theme-line-soft) !important;
    color: var(--theme-text) !important;
    box-shadow: inset 0 1px 0 rgba(var(--theme-primary-rgb), .035),
                0 12px 28px rgba(0, 0, 0, .22) !important;
}

/* PHASE 6 — MEMBER LOGIN INPUT ONLY (not Admin, Wallet, Registration, or other pages)
   Legacy member-login.css/fxkingdom-auth.css paints a 1000px GOLD inset shadow,
   including on non-autofilled inputs. Restore black background using central
   theme tokens. Limit the override to the two login card's direct input fields.
*/
body.member-login-page .member-login-card .member-dark-input > input,
body.member-login-page .member-login-card .member-dark-input > input:-webkit-autofill,
body.member-login-page .member-login-card .member-dark-input > input:-webkit-autofill:hover,
body.member-login-page .member-login-card .member-dark-input > input:-webkit-autofill:focus {
    background: var(--theme-input) !important;
    background-color: var(--theme-input) !important;
    background-image: none !important;
    -webkit-box-shadow: 0 0 0 1000px var(--theme-input) inset !important;
    box-shadow: 0 0 0 1000px var(--theme-input) inset !important;
    color: var(--theme-text) !important;
    -webkit-text-fill-color: var(--theme-text) !important;
    caret-color: var(--theme-text) !important;
}

/* PHASE 7 — Member Login "New to FXKINGDOM?" register strip ONLY.
   Restore the original dark strip after legacy / autofill / broad theme styles.
   Scope to Member Login card: Admin, Member Registration, Wallet and all other
   buttons remain untouched. Colors stay controlled by this shared theme file.
*/
html body.member-login-page .member-login-card > .register-cta.member-register-cta,
html body.member-login-page .member-login-card > .register-cta.member-register-cta:hover {
    background: var(--theme-input, #080807) !important;
    background-color: var(--theme-input, #080807) !important;
    background-image: none !important;
    border: 1px solid var(--theme-line-soft, rgba(212,168,60,.28)) !important;
    box-shadow: none !important;
    color: var(--theme-muted, #b9a17c) !important;
}
html body.member-login-page .member-login-card > .member-register-cta > span {
    color: var(--theme-muted, #b9a17c) !important;
    background: transparent !important;
    box-shadow: none !important;
}
html body.member-login-page .member-login-card > .member-register-cta > a.register-link-btn,
html body.member-login-page .member-login-card > .member-register-cta > a.register-link-btn:hover,
html body.member-login-page .member-login-card > .member-register-cta > a.register-link-btn:focus-visible {
    background: var(--theme-panel, #100e0b) !important;
    background-color: var(--theme-panel, #100e0b) !important;
    background-image: none !important;
    border-color: var(--theme-line, #665023) !important;
    color: var(--theme-primary-light, #ffdb7d) !important;
    box-shadow: none !important;
}
html body.member-login-page .member-login-card > .member-register-cta > a.register-link-btn:hover {
    border-color: var(--theme-primary, #d4a83c) !important;
}
