/* =====================================================================
   AURORA THEME – premium design layer for the /admin and /member portals.
   Loaded after portal.css: portal.css keeps page structure, this file sets
   the look (tokens, shell, components, motion) so every page is consistent.

   Brand colour still comes from Settings (--brand, set inline by the layout);
   everything else (tints, gradient, glow) is derived from it.
   ===================================================================== */

:root {
	--brand: #1e3a8a;                                      /* sapphire (Settings → Theme colour) */
	--brand-2: #2563eb;                                    /* gradient partner (bright sapphire) */
	--brand-3: #f59e0b;                                    /* accent (gold) */
	--gold: #f59e0b; --gold-2: #fbbf24; --gold-3: #fde68a; --gold-ink: #92400e; --gold-50: #fffbeb;
	--grad-gold: linear-gradient(135deg, #f59e0b 0%, #fbbf24 55%, #fde68a 100%);
	--midnight: #0b1220; --midnight-2: #13224a;
	--grad-lux: linear-gradient(135deg, var(--midnight) 0%, var(--midnight-2) 45%, var(--brand) 100%);
	--grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
	--grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--brand) 9%, #fff), color-mix(in srgb, var(--gold) 10%, #fff));
	--brand-25: color-mix(in srgb, var(--brand) 4%, #fff);
	--brand-50: color-mix(in srgb, var(--brand) 8%, #fff);
	--brand-100: color-mix(in srgb, var(--brand) 14%, #fff);
	--brand-200: color-mix(in srgb, var(--brand) 26%, #fff);
	--brand-300: color-mix(in srgb, var(--brand) 42%, #fff);
	--brand-ink: color-mix(in srgb, var(--brand) 72%, #0b1220);
	--brand-ring: color-mix(in srgb, var(--brand) 18%, transparent);
	--brand-glow: color-mix(in srgb, var(--brand) 38%, transparent);

	--ink: #0b1220;
	--ink-2: #2b3448;
	--muted: #64708a;
	--line: #e6e9f2;
	--line-2: #f0f2f7;
	--page: #f5f6fa;
	--surface: #ffffff;

	--ok: #10b981; --ok-50: #ecfdf5; --ok-ink: #047857;
	--warn: #f59e0b; --warn-50: #fffbeb; --warn-ink: #b45309;
	--bad: #ef4444; --bad-50: #fef2f2; --bad-ink: #b91c1c;
	--hot: #d97706; --hot-50: #fffbeb; --hot-ink: #92400e;

	--radius: 18px;
	--radius-sm: 12px;
	--radius-xs: 10px;
	--shadow-sm: 0 1px 2px rgba(15, 18, 34, .04), 0 2px 6px -2px rgba(15, 18, 34, .05);
	--shadow: 0 1px 2px rgba(15, 18, 34, .04), 0 12px 32px -14px rgba(15, 18, 34, .16);
	--shadow-lg: 0 30px 70px -24px rgba(15, 18, 34, .32);
	--shadow-brand: 0 12px 28px -10px var(--brand-glow);

	--bottom-h: 70px;
	--ease: cubic-bezier(.2, .8, .2, 1);

	--font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--bs-body-font-family: var(--font);
	--bs-border-radius: .75rem;
	--bs-border-radius-lg: var(--radius);
	--bs-body-color: var(--ink);
	--bs-secondary-color: var(--muted);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body.portal, body.login-page {
	font-family: var(--font);
	background: var(--page);
	color: var(--ink);
	font-size: .9375rem;
	letter-spacing: -.003em;
	font-feature-settings: "cv11", "ss01";
}
body.portal:has(.dash), body.portal:has(.mp), body.portal:has(.pl), body.portal:has(.gs) { background: var(--page); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.text-muted { color: var(--muted) !important; }
::selection { background: var(--brand-200); color: var(--ink); }
* { scrollbar-width: thin; scrollbar-color: #cfd3e3 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #d6d9e8; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: #b9bdd3; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Soft aurora glow behind the content */
.app-aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.app-aurora::before, .app-aurora::after { content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.app-aurora::before { width: 620px; height: 420px; top: -220px; right: -120px; background: color-mix(in srgb, var(--brand-2) 26%, transparent); }
.app-aurora::after { width: 560px; height: 380px; top: -200px; left: calc(var(--sb-w) + 4%); background: color-mix(in srgb, var(--brand) 20%, transparent); }

/* =====================================================================
   NAVIGATION – floating light sidebar (collapsible rail) + floating top bar
   ===================================================================== */
:root { --sb-w: 268px; --sb-rail: 84px; --gap: 10px; --nav-h: 62px; }
@media (min-width: 1200px) { :root { --gap: 14px; --nav-h: 66px; } }
kbd { font-family: var(--font); font-size: .66rem; font-weight: 700; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .12rem .4rem; box-shadow: 0 1px 0 var(--line); line-height: 1.3; }

/* ---------- Sidebar ---------- */
.app-sidebar { --bs-offcanvas-width: 296px; --bs-offcanvas-bg: transparent; --bs-offcanvas-border-width: 0; --bs-offcanvas-transition: transform .32s var(--ease); border-right: 0 !important; }
.sb-inner { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--surface); color: var(--ink-2); position: relative; overflow: hidden; }
@media (max-width: 1199.98px) { .sb-inner { border-radius: 0 26px 26px 0; box-shadow: var(--shadow-lg); } }
@media (min-width: 1200px) {
	.app-sidebar { position: fixed; top: var(--gap); bottom: var(--gap); left: var(--gap); width: var(--sb-w); z-index: 1035; transition: width .32s var(--ease); }
	.sb-inner { border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 1px 2px rgba(15, 18, 34, .03), 0 18px 40px -26px rgba(15, 18, 34, .25); }
	.app-main { margin-left: calc(var(--sb-w) + var(--gap)); transition: margin-left .32s var(--ease); }
}
/* soft brand glow in the top corner */
.sb-inner::before { content: ""; position: absolute; width: 260px; height: 200px; top: -120px; left: -80px; border-radius: 50%; background: radial-gradient(circle, var(--brand-100), transparent 70%); pointer-events: none; }

.sb-head { position: relative; display: flex; align-items: center; gap: .5rem; padding: 1.1rem .9rem .85rem 1.05rem; }
.sb-brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); min-width: 0; flex: 1 1 auto; }
.sb-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 1.15rem; }
.sb-brand .brand-name { font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.sb-brand .brand-sub { font-size: .7rem; font-weight: 600; color: var(--muted); }
.sb-logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--line); padding: 4px; flex: none; }
.sb-logo img { max-width: 100%; max-height: 100%; }
.sb-collapse, .sb-close { border: 0; width: 34px; height: 34px; border-radius: 10px; place-items: center; flex: none; background: transparent; color: var(--muted); font-size: 1.05rem; transition: background .2s, color .2s; }
.sb-close { display: grid; background: var(--line-2); }
.sb-collapse:hover, .sb-close:hover { background: var(--brand-50); color: var(--brand); }

.sb-search { position: relative; display: flex; align-items: center; gap: .55rem; margin: 0 .85rem .6rem; height: 42px; padding: 0 .55rem 0 .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--page); color: var(--muted); font-size: .86rem; font-weight: 500; text-align: left; transition: border-color .2s, background .2s, box-shadow .2s; }
.sb-search:hover { border-color: var(--brand-200); background: #fff; box-shadow: 0 0 0 4px var(--brand-ring); }
.sb-search .sb-search-text { flex: 1; }

.sb-body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .1rem .75rem .75rem; }
.app-sidebar .app-menu { gap: 2px; }
.app-sidebar .sb-label { list-style: none; padding: .95rem .6rem .4rem; font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #9aa0b6; }
.app-sidebar .sb-label:first-child { padding-top: .25rem; }

.app-sidebar .app-menu .nav-link { position: relative; display: flex; align-items: center; gap: .7rem; min-height: 46px; padding: .4rem .55rem; border-radius: 13px; color: var(--ink-2); font-weight: 600; font-size: .9rem; text-decoration: none; transition: background-color .2s, color .2s; }
.app-sidebar .nl-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--muted); transition: background .25s, color .25s, box-shadow .25s, transform .25s var(--ease); }
.app-sidebar .nl-icon i { font-size: 1.05rem; width: auto; opacity: 1; }
.app-sidebar .nl-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar .app-menu .nav-link:hover { background: var(--brand-25); color: var(--ink); }
.app-sidebar .app-menu .nav-link:hover .nl-icon { background: var(--brand-50); color: var(--brand); transform: scale(1.05); }
.app-sidebar .app-menu .nav-link.active { background: linear-gradient(90deg, var(--brand-50), var(--brand-25)); color: var(--brand-ink); }
.app-sidebar .app-menu .nav-link.active .nl-icon { background: var(--grad); color: #fff; box-shadow: 0 8px 18px -8px var(--brand-glow); }
.app-sidebar .app-menu > li > .nav-link.active:not(.menu-toggle)::after { content: ""; position: absolute; right: .55rem; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.app-sidebar .app-menu .menu-toggle::after { color: #9aa0b6; margin-left: auto; }
.app-sidebar .app-menu .menu-toggle[aria-expanded="true"]:not(.active) { color: var(--ink); }

.app-sidebar .app-menu .submenu { list-style: none; margin: .1rem 0 .35rem 1.65rem; padding: .1rem 0 .1rem .75rem; border-left: 2px solid var(--line-2); }
.app-sidebar .app-menu .submenu-title { display: none; }
.app-sidebar .app-menu .submenu a { position: relative; display: flex; align-items: center; gap: .55rem; min-height: 38px; padding: .4rem .65rem; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: .86rem; text-decoration: none; transition: background .2s, color .2s; }
.app-sidebar .app-menu .submenu a > i { font-size: .9rem; color: #a3a8bd; width: 1rem; text-align: center; transition: color .2s; }
.app-sidebar .app-menu .submenu a > span { flex: 1 1 auto; min-width: 0; }
.app-sidebar .app-menu .submenu a:hover { background: var(--brand-25); color: var(--ink); }
.app-sidebar .app-menu .submenu a:hover > i { color: var(--brand); }
.app-sidebar .app-menu .submenu a.active { background: var(--brand-50); color: var(--brand-ink); font-weight: 700; }
.app-sidebar .app-menu .submenu a.active > i { color: var(--brand); }
.app-sidebar .app-menu .submenu a.active::before { content: ""; position: absolute; left: calc(-.75rem - 2px); top: 22%; bottom: 22%; width: 2px; border-radius: 2px; background: var(--grad); }
.app-sidebar .app-menu .submenu .divider { height: 1px; background: var(--line-2); margin: .3rem .5rem; }
.app-sidebar .nav-badge { margin-left: auto; background: var(--grad-gold); color: #3b2300; box-shadow: 0 4px 10px -3px rgba(245, 158, 11, .6); }
.app-sidebar .menu-toggle .nav-badge { margin-left: auto; margin-right: .35rem; }
.app-sidebar .menu-toggle .nav-badge + *, .app-sidebar .menu-toggle:has(.nav-badge)::after { margin-left: 0; }

.sb-foot { position: relative; padding: .75rem; display: grid; gap: .6rem; }
.sb-spot { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; column-gap: .7rem; align-items: center; padding: .9rem 1rem; border-radius: 18px; color: #fff; text-decoration: none; background: radial-gradient(160px 120px at 100% 0%, color-mix(in srgb, var(--brand-3) 55%, transparent), transparent 70%), var(--grad); box-shadow: 0 16px 30px -16px var(--brand-glow); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.sb-spot::after { content: ""; position: absolute; width: 120px; height: 120px; right: -40px; bottom: -60px; border-radius: 50%; border: 20px solid rgba(255,255,255,.1); }
.sb-spot:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 20px 36px -16px var(--brand-glow); }
.sb-spot-icon { grid-row: span 2; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); font-size: 1.05rem; }
.sb-spot-label { font-size: .72rem; font-weight: 700; color: rgba(255,255,255,.8); }
.sb-spot-value { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-spot-note { grid-column: 1 / -1; margin-top: .55rem; padding-top: .55rem; border-top: 1px solid rgba(255,255,255,.18); font-size: .74rem; font-weight: 600; color: rgba(255,255,255,.85); display: flex; align-items: center; gap: .3rem; }
.sb-spot-note i { margin-left: auto; transition: transform .3s var(--ease); }
.sb-spot:hover .sb-spot-note i { transform: translateX(3px); }
.sb-user { display: flex; align-items: center; gap: .65rem; padding: .55rem .55rem .55rem .6rem; border-radius: 15px; background: var(--page); border: 1px solid var(--line); font-size: .86rem; color: var(--ink); }
.sb-user .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.sb-avatar { width: 38px; height: 38px; font-size: 13px; }
.sb-user-sub { color: var(--muted); font-size: .72rem; }
.sb-logout { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); text-decoration: none; flex: none; transition: background .2s, color .2s; }
.sb-logout:hover { background: var(--bad-50); color: var(--bad); }
.portal-admin .sb-avatar, .portal-admin .nb-user .avatar-initials, .portal-admin .nb-profile .avatar-initials { background: var(--grad) !important; }

/* ---------- Collapsed rail (desktop) ---------- */
@media (min-width: 1200px) {
	body.sb-collapsed .app-sidebar { width: var(--sb-rail); }
	body.sb-collapsed .app-main { margin-left: calc(var(--sb-rail) + var(--gap)); }
	body.sb-collapsed .app-nav { left: calc(var(--sb-rail) + var(--gap) * 2); }
	body.sb-collapsed .sb-inner, body.sb-collapsed .sb-body { overflow: visible; }
	body.sb-collapsed .sb-inner::before { display: none; }
	body.sb-collapsed .sb-head { flex-direction: column; padding: 1rem .5rem .6rem; gap: .6rem; }
	body.sb-collapsed .sb-brand { flex: none; }
	body.sb-collapsed .sb-brand-text, body.sb-collapsed .sb-search-text, body.sb-collapsed .sb-search kbd,
	body.sb-collapsed .nl-text, body.sb-collapsed .app-menu .menu-toggle::after, body.sb-collapsed .sb-user-text,
	body.sb-collapsed .sb-spot-label, body.sb-collapsed .sb-spot-value, body.sb-collapsed .sb-spot-note { display: none; }
	body.sb-collapsed .sb-collapse i { transform: scaleX(-1); }
	body.sb-collapsed .sb-search { margin: 0 auto .5rem; width: 44px; padding: 0; justify-content: center; }
	body.sb-collapsed .sb-body { padding: .1rem .6rem .6rem; }
	body.sb-collapsed .app-sidebar .sb-label { padding: .6rem 0 .35rem; }
	body.sb-collapsed .app-sidebar .sb-label span { display: block; height: 1px; font-size: 0; background: var(--line); margin: 0 .55rem; }
	body.sb-collapsed .app-sidebar .app-menu .nav-link { justify-content: center; padding: .4rem; }
	body.sb-collapsed .app-sidebar .app-menu > li > .nav-link.active::after { right: -.35rem; }
	body.sb-collapsed .app-sidebar .nav-link .nav-badge { position: absolute; top: 2px; right: 4px; min-width: 18px; height: 18px; font-size: .62rem; padding: 0 .3rem; margin: 0; }
	/* tooltips for single links */
	body.sb-collapsed .app-sidebar .app-menu > li:not(.has-sub) > .nav-link:hover::before { content: attr(data-label); position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--ink); color: #fff; font-size: .78rem; font-weight: 600; padding: .38rem .65rem; border-radius: 9px; box-shadow: var(--shadow); z-index: 1060; pointer-events: none; }
	/* groups open as a flyout */
	body.sb-collapsed .app-sidebar .has-sub { position: relative; }
	body.sb-collapsed .app-sidebar .app-menu .submenu { display: none !important; position: absolute; left: calc(100% + 14px); top: -.3rem; z-index: 1060; min-width: 230px; margin: 0; padding: .45rem; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); animation: drop-in .18s var(--ease); }
	body.sb-collapsed .app-sidebar .app-menu .submenu::before { content: ""; position: absolute; left: -16px; top: 0; bottom: 0; width: 16px; }
	body.sb-collapsed .app-sidebar .has-sub:hover > .submenu, body.sb-collapsed .app-sidebar .has-sub:focus-within > .submenu { display: block !important; }
	body.sb-collapsed .app-sidebar .app-menu .submenu-title { display: block; padding: .35rem .65rem .45rem; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #9aa0b6; }
	body.sb-collapsed .app-sidebar .app-menu .submenu a.active::before { display: none; }
	body.sb-collapsed .sb-foot { padding: .6rem; justify-items: center; }
	body.sb-collapsed .sb-spot { display: grid; place-items: center; padding: .45rem; width: 52px; height: 52px; border-radius: 15px; grid-template-columns: 1fr; }
	body.sb-collapsed .sb-spot::after { display: none; }
	body.sb-collapsed .sb-spot-icon { grid-row: auto; background: transparent; border: 0; }
	body.sb-collapsed .sb-user { flex-direction: column; padding: .45rem; gap: .35rem; }
}

/* ---------- Floating top bar ---------- */
.app-nav { top: calc(var(--gap) + env(safe-area-inset-top)); left: var(--gap); right: var(--gap); height: var(--nav-h); padding-top: 0; border-radius: 20px; background: rgba(255,255,255,.8); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border: 1px solid rgba(232, 234, 243, .95); box-shadow: 0 1px 2px rgba(15, 18, 34, .03), 0 14px 32px -22px rgba(15, 18, 34, .3); transition: left .32s var(--ease); }
@media (min-width: 1200px) { .app-nav { left: calc(var(--sb-w) + var(--gap) * 2); } }
.app-bar { height: 100%; padding: 0 .45rem; gap: .45rem; }
@media (min-width: 768px) { .app-bar { padding: 0 .65rem 0 .9rem; } }
@media (min-width: 1200px) { .app-bar { padding: 0 .65rem 0 1.25rem; } }
.app-bar-title { font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em; }
.nb-title { flex: 0 1 auto; }
.nb-crumb { display: flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 600; color: var(--muted); line-height: 1.2; }
.nb-crumb a { color: var(--muted); text-decoration: none; }
.nb-crumb a:hover { color: var(--brand); }
.nb-crumb i { font-size: .55rem; opacity: .7; }
.nb-page { font-size: 1.06rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.3; max-width: 38vw; }
.nb-search { align-items: center; gap: .55rem; margin-left: auto; flex: 0 1 320px; min-width: 0; height: 42px; padding: 0 .5rem 0 .85rem; border: 1px solid var(--line); border-radius: 13px; background: var(--page); color: var(--muted); font-size: .86rem; font-weight: 500; text-align: left; transition: border-color .2s, background .2s, box-shadow .2s; }
.nb-search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-search:hover { border-color: var(--brand-200); background: #fff; box-shadow: 0 0 0 4px var(--brand-ring); }
.nb-search + .nav-actions { margin-left: .5rem; }
@media (max-width: 767.98px) { .nb-search + .nav-actions { margin-left: auto; } }
.nav-actions { gap: .4rem; }
.btn-icon { width: 42px; height: 42px; border-radius: 13px; background: transparent; border: 1px solid transparent; box-shadow: none; color: var(--ink-2); }
.btn-icon:hover { background: var(--brand-50); border-color: transparent; color: var(--brand); transform: none; }
.dot-badge { top: 4px; right: 4px; box-shadow: 0 0 0 2px #fff; }
.nb-create { display: inline-flex; align-items: center; gap: .4rem; height: 42px; padding: 0 .95rem; border: 0; border-radius: 13px; background: var(--grad); color: #fff; font-weight: 700; font-size: .86rem; box-shadow: var(--shadow-brand); transition: transform .2s var(--ease), box-shadow .2s; }
.nb-create:hover, .nb-create[aria-expanded="true"] { transform: translateY(-1px); box-shadow: 0 16px 30px -12px var(--brand-glow); }
.nb-create i { font-size: 1rem; transition: transform .25s var(--ease); }
.nb-create[aria-expanded="true"] i { transform: rotate(45deg); }
@media (max-width: 991.98px) { .nb-create { width: 42px; padding: 0; justify-content: center; } }
.nb-user { display: inline-flex; align-items: center; gap: .55rem; height: 44px; padding: 0 .3rem; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--ink); font-size: .84rem; transition: background .2s, border-color .2s; }
.nb-user:hover, .nb-user[aria-expanded="true"] { background: #fff; border-color: var(--line); }
.nb-user .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--brand-200); }
.nb-user-sub { font-size: .7rem; color: var(--muted); }
.nb-user .bi-chevron-down { font-size: .7rem; color: var(--muted); margin-right: .25rem; }
@media (min-width: 1400px) { .nb-user { padding-right: .4rem; } }
.nb-quick { min-width: 300px; }
.nb-quick .dropdown-header { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #9aa0b6; padding: .45rem .75rem .35rem; }
.nb-quick .dropdown-item { gap: .75rem; padding: .55rem .65rem; white-space: normal; }
.nq-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand) !important; font-size: 1.05rem; transition: background .2s, color .2s; }
.nb-quick .dropdown-item:hover .nq-icon { background: var(--grad); color: #fff !important; }
.nb-quick .nq-icon i { color: inherit !important; width: auto; }
.nb-profile { min-width: 260px; }
.nb-profile-head { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem .8rem; margin-bottom: .35rem; border-bottom: 1px solid var(--line-2); }

/* Content offsets for the floating bars */
.content { padding-top: calc(var(--nav-h) + var(--gap) + env(safe-area-inset-top) + 1.1rem); }
@media (min-width: 1200px) { .content { padding: calc(var(--nav-h) + var(--gap) + 1.6rem) 1.6rem 2.5rem 1.6rem; } }
.toast-stack { top: calc(var(--nav-h) + var(--gap) + .75rem); }
.app-aurora::after { left: 30%; }

/* ---------- Search pages (Ctrl + K) ---------- */
.cmdk-dialog { max-width: 600px; margin-top: 11vh; }
.cmdk { border-radius: 22px; overflow: hidden; }
.cmdk-input { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.cmdk-input > i { color: var(--brand); font-size: 1.15rem; }
.cmdk-input input { flex: 1; border: 0; outline: 0; font-size: 1.05rem; font-weight: 500; color: var(--ink); background: transparent; min-width: 0; }
.cmdk-input input::-webkit-search-cancel-button { display: none; }
.cmdk-list { list-style: none; margin: 0; padding: 0; max-height: 52vh; }
.cmdk-group { font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #9aa0b6; padding: .6rem .75rem .3rem; }
.cmdk-item a { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; }
.cmdk-item .ci-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--muted); }
.cmdk-item .ci-sub { font-size: .76rem; color: var(--muted); font-weight: 500; }
.cmdk-item .ci-go { margin-left: auto; color: var(--brand); opacity: 0; transition: opacity .15s; }
.cmdk-item.is-active a { background: var(--brand-50); }
.cmdk-item.is-active .ci-icon { background: var(--grad); color: #fff; }
.cmdk-item.is-active .ci-go { opacity: 1; }
.cmdk-empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.cmdk-foot { display: flex; gap: 1.2rem; padding: .6rem 1.1rem; border-top: 1px solid var(--line-2); background: var(--brand-25); font-size: .74rem; color: var(--muted); }
.cmdk-foot kbd { margin-right: .2rem; }
@media (max-width: 575.98px) { .cmdk-dialog { margin-top: 0; } .cmdk-foot { display: none; } .cmdk-input input { font-size: 16px; } }

/* Brand mark */
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: var(--grad); box-shadow: 0 10px 24px -8px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.25); font-size: 1.25rem; }
.dot-badge { background: linear-gradient(135deg, #fb7185, #ef4444); animation: pulse-badge 2.4s infinite; }
@keyframes pulse-badge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.page-loader { background: var(--grad); height: 3px; box-shadow: 0 0 12px var(--brand-glow); }
.nav-date { display: none !important; }

/* ---------- Content & page head ---------- */
.content { max-width: 1520px; animation: page-in .45s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-head { margin-bottom: 1.5rem; }
.page-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -.035em; }
.page-sub { color: var(--muted); font-size: .9rem; margin-top: .25rem; }
.section-title { color: var(--muted); font-size: .72rem; letter-spacing: .12em; margin: 2rem 0 .85rem; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* Reveal: cards rise in one after another */
.content .row > [class*="col"] { animation: rise .55s var(--ease) both; }
.content .row > [class*="col"]:nth-child(2) { animation-delay: .05s; }
.content .row > [class*="col"]:nth-child(3) { animation-delay: .1s; }
.content .row > [class*="col"]:nth-child(4) { animation-delay: .15s; }
.content .row > [class*="col"]:nth-child(5) { animation-delay: .2s; }
.content .row > [class*="col"]:nth-child(n+6) { animation-delay: .25s; }
.content form .row > [class*="col"], .filter-bar .row > [class*="col"], .modal .row > [class*="col"] { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
.card-header { padding: 1rem 1.3rem; font-weight: 700; font-size: .98rem; border-bottom: 1px solid var(--line-2); letter-spacing: -.01em; }
.card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-body { padding: 1.3rem; }
.card-footer { background: var(--brand-25); border-top-color: var(--line-2); border-radius: 0 0 var(--radius) var(--radius) !important; }
.card-hover { transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brand-200); }
.card:has(.admin-table) { border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }

/* Stat cards */
.stat { gap: 1rem; padding: 1.2rem 1.3rem; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.stat::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c, var(--brand)) 14%, transparent), transparent 70%); pointer-events: none; }
.stat.p-0 { overflow: visible; }
.stat.p-0::after { display: none; }
.stat-icon { width: 50px; height: 50px; border-radius: 15px; font-size: 1.3rem; background: linear-gradient(135deg, color-mix(in srgb, var(--c, var(--brand)) 16%, #fff), color-mix(in srgb, var(--c, var(--brand)) 8%, #fff)); color: var(--c, var(--brand)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--brand)) 12%, transparent); }
.stat-label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.035em; }
.stat-value.money { font-size: 1.35rem; }
a.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
a.stat:hover .stat-icon { background: var(--c, var(--brand)); color: #fff; }
.level-pill { padding: .35rem .8rem; }

/* ---------- Buttons ---------- */
.btn { border-radius: 12px; font-weight: 600; padding: .55rem 1.05rem; letter-spacing: -.005em; transition: transform .2s var(--ease), box-shadow .2s, background-color .2s, border-color .2s, color .2s; }
.btn-sm { border-radius: 10px; padding: .32rem .7rem; font-size: .82rem; }
.btn-lg { border-radius: 14px; padding: .8rem 1.3rem; }
.btn:active { transform: scale(.97); }
.btn-primary { border: 0; background: var(--grad); background-size: 140% 140%; background-position: 0% 50%; color: #fff; box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255,255,255,.2); --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; --bs-btn-disabled-bg: var(--brand); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--grad); background-size: 140% 140%; background-position: 100% 50%; color: #fff; transform: translateY(-1px); box-shadow: 0 16px 32px -12px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-primary:active, .btn-primary.active { background: var(--brand) !important; color: #fff; }
.btn-primary:disabled, .btn-primary.disabled { background: var(--grad); opacity: .6; }
.btn-outline-primary { --bs-btn-border-color: var(--brand-200); }
.btn-outline-primary:hover { box-shadow: var(--shadow-brand); }
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-hover-bg: var(--brand-25); --bs-btn-color: var(--ink-2); --bs-btn-hover-color: var(--brand); }
.btn-light.border { border-color: var(--line) !important; box-shadow: var(--shadow-sm); }
.btn-light.border:hover { border-color: var(--brand-200) !important; }
.btn-success { border: 0; background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 10px 22px -10px rgba(16, 185, 129, .6); }
.btn-success:hover { background: linear-gradient(135deg, #10b981, #047857); transform: translateY(-1px); }
.btn-danger { border: 0; background: linear-gradient(135deg, #f43f5e, #e11d48); box-shadow: 0 10px 22px -10px rgba(225, 29, 72, .55); }
.btn-warning { border: 0; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #451a03; }
.btn-check:checked + .btn-outline-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.btn-group > .btn { border-radius: 12px; }
.btn-group > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group > .btn:not(:first-child), .btn-group > .btn-check + .btn:not(:first-of-type) { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 12px; border: 1px solid #dfe2ee; background-color: #fff; padding: .62rem .9rem; color: var(--ink); transition: border-color .2s, box-shadow .2s, background-color .2s; }
.form-control::placeholder { color: #a3a8bd; }
.form-control:hover, .form-select:hover { border-color: #cdd1e2; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.form-control-sm, .form-select-sm { border-radius: 10px; padding: .35rem .7rem; }
.form-label { font-weight: 700; font-size: .82rem; color: var(--ink-2); }
.input-group-text { background: var(--brand-25); border-color: #dfe2ee; color: var(--muted); border-radius: 12px; }
.form-check-input { border-color: #cdd1e2; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--brand-ring); border-color: var(--brand); }
.form-switch .form-check-input { width: 2.4em; }
.form-section { font-size: 1rem; font-weight: 800; letter-spacing: -.015em; margin-bottom: 1.1rem; }
.form-section i { width: 36px; height: 36px; border-radius: 11px; background: var(--grad-soft); color: var(--brand); }
.filter-bar { border-radius: var(--radius); padding: 1rem; border-color: var(--line); box-shadow: var(--shadow-sm); }
.sticky-actions { padding-top: 1.25rem; }
.ts-control { border-radius: 12px !important; border-color: #dfe2ee !important; }
.ts-wrapper.focus .ts-control { border-color: var(--brand) !important; box-shadow: 0 0 0 4px var(--brand-ring) !important; }

/* ---------- Badges, pills, tabs, dropdowns, modals, alerts ---------- */
.badge { border-radius: 8px; font-weight: 700; padding: .38em .62em; }
.badge.rounded-pill { border-radius: 999px !important; }
.nav-pills .nav-link { border-radius: 12px; font-weight: 600; }
.nav-pills .nav-link.active { background: var(--grad); box-shadow: var(--shadow-brand); }
.status-tabs a, .mp-tab { border-radius: 12px; font-weight: 600; background: var(--surface); box-shadow: var(--shadow-sm); transition: all .2s var(--ease); }
.status-tabs a:hover, .mp-tab:hover { transform: translateY(-1px); }
.status-tabs a.active, .mp-tab.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.mp-tab-count { background: var(--brand-50); color: var(--brand); }
.mp-toggle { border-radius: 14px; padding: 4px; box-shadow: var(--shadow-sm); border-color: var(--line); }
.mp-toggle button { border-radius: 10px; font-weight: 600; }
.mp-toggle button.active { background: var(--grad); box-shadow: var(--shadow-brand); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: .45rem; animation: drop-in .18s var(--ease); }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.dropdown-item { border-radius: 10px; font-weight: 500; }
.dropdown-item:hover { background: var(--brand-50); color: var(--ink); }
.dropdown-item.active, .dropdown-item:active { background: var(--brand-50); color: var(--brand); }
.modal-content { border-radius: 22px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--line-2); padding: 1.15rem 1.4rem; }
.modal-footer { border-top-color: var(--line-2); }
.modal-backdrop.show { opacity: .45; backdrop-filter: blur(4px); }
.modal-backdrop { background-color: #0b1220; }
.alert { border: 0; border-radius: 14px; padding: .9rem 1.1rem; box-shadow: var(--shadow-sm); }
.alert-warning { background: var(--warn-50); color: var(--warn-ink); box-shadow: inset 4px 0 0 var(--warn), var(--shadow-sm); }
.alert-info { background: var(--brand-50); color: var(--brand-ink); box-shadow: inset 4px 0 0 var(--brand), var(--shadow-sm); }
.alert-success { background: var(--ok-50); color: var(--ok-ink); box-shadow: inset 4px 0 0 var(--ok), var(--shadow-sm); }
.alert-danger { background: var(--bad-50); color: var(--bad-ink); box-shadow: inset 4px 0 0 var(--bad), var(--shadow-sm); }
.pagination { gap: 6px; }
.page-link { border-radius: 10px !important; border-color: var(--line); color: var(--ink-2); font-weight: 600; min-width: 36px; text-align: center; }
.page-link:hover { background: var(--brand-50); color: var(--brand); border-color: var(--brand-200); }
.active > .page-link, .page-link.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.toast { border-radius: 16px; backdrop-filter: blur(10px); }
.nav-badge { background: var(--grad-gold); color: #3b2300; }
.nav-badge:hover { background: var(--bad-ink); color: #fff; }

/* ---------- Tables (one modern style everywhere) ---------- */
.table > :not(caption) > * > * { padding: .85rem 1rem; border-bottom-color: var(--line-2); }
.table thead th, .mp-table > thead > tr > th, .pl-table > thead > tr > th, .pc-table th {
	background: var(--brand-25); color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line);
}
.table-hover > tbody > tr:hover > *, .mp-table > tbody > tr:hover > td { --bs-table-bg-state: var(--brand-25); background-color: var(--brand-25); }
.admin-table > thead > tr { background: var(--brand-25); }
.admin-table > thead > tr > th { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; padding: .95rem 1rem; border-bottom: 1px solid var(--line); }
.admin-table > thead > tr > th a { color: var(--muted) !important; }
.admin-table > tbody > tr > td { padding: .9rem 1rem; border-bottom: 1px solid var(--line-2); }
.admin-table > tbody > tr:nth-child(even) > td { background-color: #fcfcfe; }
.admin-table > tbody > tr:hover > td { background-color: var(--brand-25); }
.admin-table .mt-avatar, .mp-avatar, .dash-avatar { box-shadow: inset 0 0 0 1px rgba(15, 18, 34, .04); }
.mp-panel, .pl-box, .po-filters, .gs-card, .dash-card, .po-sum, .mp-summary { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow-sm); }
.mp-list-head { font-size: 1rem; padding: 1.05rem 1.25rem; border-bottom-color: var(--line-2); }
.mp-level, .pc-lv { border-radius: 8px; }
.mp-lv-1, .pc-lv-1, .pl-r1 { background: var(--grad); }
.mp-lv-2, .pc-lv-2, .pl-r2 { background: color-mix(in srgb, var(--brand-3) 85%, #000); color: #fff; }
.mp-status, .po-status { border-radius: 8px; white-space: nowrap; display: inline-flex; align-items: center; }
.mp-table > thead > tr > th, .mp-table > tbody > tr > td { padding-left: .8rem; padding-right: .8rem; }
.mp-filters input[type="date"], .mp-filters input.dp-input { min-width: 0; padding-left: .6rem; padding-right: .4rem; font-size: .85rem; }
.mp-filters .d-flex > input[type="date"], .mp-filters .d-flex > input.dp-input { flex: 1 1 0; }
.mp-status-on::before, .mp-status-off::before, .po-paid::before, .po-pending::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .35rem; vertical-align: 1px; }
.mp-card, .pl-svc-card { border-radius: 16px; border-color: var(--line); box-shadow: var(--shadow-sm); }
.mp-node { border-radius: 16px; box-shadow: var(--shadow-sm); }
.mp-node:hover { box-shadow: var(--shadow); }
.mp-tree-scroll { background: radial-gradient(circle, #dcdff0 1px, transparent 1px) 0 0 / 22px 22px, var(--brand-25); }
.btn.action-btn { border-radius: 11px; }

/* Plan cards */
.pc-card { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 1.35rem; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; overflow: hidden; }
.pc-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); opacity: .85; }
.pc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pc-price { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.8rem; letter-spacing: -.03em; }
.pc-radio:checked + .pc-card { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-ring), var(--shadow); }
.pc-table { border-radius: 12px; border-color: var(--line); }
.pc-note, .gs-note { background: var(--grad-soft); color: var(--brand-ink); border-radius: 14px; }
.price-card { border-radius: 22px; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.price-card.featured { border: 0; box-shadow: 0 0 0 2px var(--brand), 0 24px 50px -20px var(--brand-glow); }
.price-card .price { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Payout */
.po-pending-card { border-radius: var(--radius); border: 1px solid #fed7aa; border-left-width: 1px; background: linear-gradient(120deg, #fff7ed, #fff 60%); box-shadow: inset 5px 0 0 var(--hot), var(--shadow-sm); }
.po-pending-icon, .mp-summary-icon { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; box-shadow: 0 10px 22px -10px rgba(249, 115, 22, .6); }
.po-sum-icon { border-radius: 14px; width: 48px; height: 48px; }
.po-ic-total { background: var(--grad); color: #fff; box-shadow: var(--shadow-brand); }
.po-ic-paid { background: linear-gradient(135deg, #34d399, #10b981); color: #fff; }
.po-ic-pending { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; }
.po-sum-value { font-weight: 800; letter-spacing: -.03em; }
.gs-title i { background: var(--grad-soft); }

/* Timeline / stepper */
.timeline li::after { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.stepper .step.done .dot { background: var(--grad); border-color: transparent; }

/* ---------- Dashboard (admin + member) ---------- */
.hero {
	position: relative; overflow: hidden; border-radius: 26px; color: #fff; padding: 1.75rem;
	background:
		radial-gradient(600px 300px at 100% 0%, color-mix(in srgb, var(--brand-3) 45%, transparent), transparent 60%),
		radial-gradient(500px 340px at 0% 100%, color-mix(in srgb, var(--brand-2) 70%, transparent), transparent 65%),
		linear-gradient(135deg, var(--brand-ink) 0%, var(--brand) 55%, var(--brand-2) 100%);
	box-shadow: 0 30px 60px -28px var(--brand-glow);
	display: grid; gap: 1.5rem; align-items: center; margin-bottom: 1.5rem;
	animation: rise .6s var(--ease) both;
}
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 20px 20px; mask-image: linear-gradient(110deg, transparent 30%, #000); pointer-events: none; }
.hero::after { content: ""; position: absolute; width: 340px; height: 340px; right: -110px; bottom: -170px; border-radius: 50%; border: 56px solid rgba(255,255,255,.07); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
@media (min-width: 992px) { .hero { grid-template-columns: 1.25fr 1fr; padding: 2.25rem 2.5rem; } }
.hero-eyebrow { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 700; letter-spacing: .04em; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); padding: .32rem .75rem; border-radius: 999px; backdrop-filter: blur(6px); }
.hero-title { color: #fff; font-size: clamp(1.55rem, 2.6vw, 2.25rem); font-weight: 800; letter-spacing: -.028em; line-height: 1.12; margin: .9rem 0 .5rem; }
.hero-sub { color: rgba(255,255,255,.78); margin: 0 0 1.25rem; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn-hero { background: #fff; color: var(--brand-ink); border: 0; box-shadow: 0 12px 24px -12px rgba(0,0,0,.4); }
.btn-hero:hover { background: #fff; color: var(--brand); transform: translateY(-2px); }
.btn-glass { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255,255,255,.24); color: #fff; transform: translateY(-2px); }
.hero-panel { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 20px; padding: 1.35rem 1.4rem; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.hero-panel-label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: .45rem; }
.hero-amount { font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.1; margin: .35rem 0 .2rem; color: #fff; font-variant-numeric: tabular-nums; }
.hero-note { color: rgba(255,255,255,.75); font-size: .85rem; }
.hero-split { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,.16); }
.hero-split span { display: block; font-size: .74rem; color: rgba(255,255,255,.7); font-weight: 600; }
.hero-split b { display: block; font-size: 1.05rem; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.hero-split small { display: inline-block; margin-top: .15rem; font-size: .7rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; }
.hero-user { display: flex; align-items: center; gap: .9rem; }
.hero-user .avatar { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.hero-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.2); color: #fff; }

.dash-card { padding: 1.4rem 1.45rem; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.dash-stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.dash-stat::after { content: ""; position: absolute; right: -50px; top: -50px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tone, var(--brand)) 16%, transparent), transparent 70%); }
.dash-icon { width: 50px; height: 50px; border-radius: 15px; font-size: 1.3rem; background: linear-gradient(135deg, var(--tone, var(--brand)), color-mix(in srgb, var(--tone, var(--brand)) 60%, #fff)); color: #fff; box-shadow: 0 12px 22px -12px var(--tone, var(--brand)); margin-bottom: 1rem; }
.dash-label { font-weight: 600; }
.dash-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.04em; }
.dash-trend { display: inline-flex; align-items: center; gap: .25rem; margin-top: .55rem; font-size: .75rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--tone, var(--brand)) 10%, #fff); color: color-mix(in srgb, var(--tone, var(--brand)) 80%, #000); }
.tone-1 { --tone: var(--brand); }
.tone-2 { --tone: #d97706; }
.tone-3 { --tone: #10b981; }
.tone-4 { --tone: #0284c7; }
.tone-5 { --tone: #e11d48; }
.dash-card-title { font-size: 1.02rem; font-weight: 800; letter-spacing: -.02em; }
.dash-top li { padding: .85rem .5rem; margin: 0 -.5rem; border-radius: 12px; border-bottom-color: var(--line-2); transition: background .2s; }
.dash-top li:hover { background: var(--brand-25); }
.dash-rank { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--line-2); font-size: .78rem; }
.dash-top li:nth-child(1) .dash-rank { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.dash-top li:nth-child(2) .dash-rank { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.dash-top li:nth-child(3) .dash-rank { background: linear-gradient(135deg, #fed7aa, #ea580c); color: #fff; }
.dash-top-amt { background: var(--ok-50); color: var(--ok-ink); padding: .25rem .6rem; border-radius: 9px; font-size: .86rem; }
.quick-link { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; height: 100%; }
.quick-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-200); color: var(--ink); }
.quick-link .ql-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.2rem; flex: none; background: color-mix(in srgb, var(--tone, var(--brand)) 12%, #fff); color: var(--tone, var(--brand)); transition: background .3s, color .3s; }
.quick-link:hover .ql-icon { background: var(--tone, var(--brand)); color: #fff; }
.quick-link .ql-title { font-weight: 700; font-size: .92rem; display: block; }
.quick-link .ql-sub { color: var(--muted); font-size: .78rem; display: block; }
.quick-link .bi-arrow-right { margin-left: auto; color: var(--muted); transition: transform .3s var(--ease), color .3s; }
.quick-link:hover .bi-arrow-right { transform: translateX(4px); color: var(--brand); }
@media (max-width: 575.98px) {
	.hero { padding: 1.35rem; border-radius: 22px; }
	.hero-panel { padding: 1.1rem; }
	.dash-value { font-size: 1.35rem; }
	.dash-icon { width: 42px; height: 42px; font-size: 1.1rem; }
}

/* ---------- Floating bottom nav (phones / tablets) ---------- */
@media (max-width: 1199.98px) {
	.bottom-nav { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 64px; padding-bottom: 0; border-radius: 22px; border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); box-shadow: 0 18px 40px -16px rgba(15, 18, 34, .35); }
	.bottom-nav a, .bottom-nav button { font-weight: 600; font-size: .68rem; }
	.bottom-nav a.active { color: var(--brand); }
	.bottom-nav a.active::before { top: auto; bottom: 6px; left: 50%; right: auto; width: 5px; height: 5px; border-radius: 50%; transform: translateX(-50%); background: var(--brand); }
	.bottom-nav a.active i { transform: translateY(-2px); }
	.content { padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 2rem); }
	.fab-float { bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 18px); }
	.app-aurora::after { left: 0; }
}
.fab-float { background: var(--grad); border-radius: 20px; box-shadow: 0 16px 32px -10px var(--brand-glow); }

/* ---------- Login ---------- */
body.login-page { display: block; background: #0b1220; color: #fff; overflow-x: hidden; }
.login-page { min-height: 100vh; min-height: 100dvh; }
.lg-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: radial-gradient(1200px 700px at 80% -10%, color-mix(in srgb, var(--brand) 35%, transparent), transparent 60%), #0b1220; }
.lg-bg::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%); }
.lg-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .65; animation: float 18s ease-in-out infinite; }
.lg-blob.b1 { width: 520px; height: 520px; left: -140px; top: -120px; background: var(--brand); }
.lg-blob.b2 { width: 460px; height: 460px; right: -120px; bottom: -140px; background: var(--brand-2); animation-delay: -6s; }
.lg-blob.b3 { width: 320px; height: 320px; left: 40%; top: 55%; background: var(--brand-3); opacity: .35; animation-delay: -12s; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(40px, -30px) scale(1.08); } 66% { transform: translate(-30px, 30px) scale(.95); } }
.lg-wrap { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .lg-wrap { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.lg-hero { display: none; padding: 3rem 3.5rem; flex-direction: column; justify-content: space-between; }
@media (min-width: 992px) { .lg-hero { display: flex; } }
.lg-brand { display: flex; align-items: center; gap: .75rem; font-weight: 800; font-size: 1.2rem; }
.lg-brand img { max-height: 42px; background: #fff; border-radius: 12px; padding: 4px; }
.lg-kicker { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; padding: .4rem .85rem; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #e0e3f5; }
.lg-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; animation: pulse-badge 2s infinite; }
.lg-title { font-size: clamp(2.2rem, 3.6vw, 3.4rem); font-weight: 800; letter-spacing: -.028em; line-height: 1.08; margin: 1.25rem 0 1rem; color: #fff; }
.lg-title .grad { background: linear-gradient(120deg, #fde68a, #fbbf24 45%, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-lead { color: #a9aecb; font-size: 1.05rem; max-width: 520px; }
/* Floating preview cards */
.lg-preview { position: relative; height: 250px; margin-top: 2.25rem; max-width: 560px; }
.lg-card { position: absolute; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; padding: 1.1rem 1.25rem; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); animation: bob 7s ease-in-out infinite; }
.lg-card .lbl { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9ba1c4; }
.lg-card .val { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; color: #fff; }
.lg-card .up { font-size: .75rem; font-weight: 700; color: #34d399; }
.lg-card.c1 { left: 0; top: 0; width: 240px; z-index: 1; }
.lg-card.c2 { left: 265px; top: 40px; width: 260px; z-index: 2; animation-delay: -2.5s; }
.lg-card.c3 { left: 110px; top: 160px; width: 220px; z-index: 3; animation-delay: -5s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.lg-bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; margin-top: .5rem; }
.lg-bars span { flex: 1; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #fde68a, #d97706); opacity: .9; animation: grow 1.2s var(--ease) both; transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.lg-avatars { display: flex; margin-top: .55rem; }
.lg-avatars span { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #1a1d33; margin-left: -8px; display: grid; place-items: center; font-size: .68rem; font-weight: 800; color: #fff; }
.lg-avatars span:first-child { margin-left: 0; }
.lg-foot { color: #7c819f; font-size: .82rem; }
.lg-main { display: flex; align-items: center; justify-content: center; padding: 1.25rem; min-width: 0; }
.lg-card-form { width: 100%; max-width: 440px; background: rgba(255,255,255,.98); color: var(--ink); border-radius: 28px; padding: 2.4rem 2rem 2rem; box-shadow: 0 40px 90px -30px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.1); animation: rise .7s var(--ease) both; }
@media (max-width: 575.98px) { .lg-card-form { padding: 2rem 1.35rem 1.6rem; border-radius: 24px; } }
.lg-card-form .brand-mark-lg { width: 64px; height: 64px; border-radius: 20px; font-size: 1.9rem; }
.lg-pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 700; padding: .35rem .8rem; border-radius: 999px; background: var(--grad-soft); color: var(--brand-ink); }
.lg-field { position: relative; margin-bottom: 1rem; }
.lg-field > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #9ba0b8; font-size: 1.05rem; z-index: 2; pointer-events: none; transition: color .2s; }
.lg-field .form-control { height: 3.4rem; padding-left: 2.85rem; border-radius: 14px; background: #f6f7fb; border-color: transparent; font-weight: 500; }
.lg-field .form-control:focus { background: #fff; border-color: var(--brand); }
.lg-field:focus-within > i { color: var(--brand); }
.lg-field .pw-toggle { right: .5rem; color: #9ba0b8; text-decoration: none; }
.lg-label { font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-bottom: .4rem; display: block; }
.lg-submit { height: 3.3rem; border-radius: 14px; font-size: 1rem; }
.lg-submit i { transition: transform .3s var(--ease); }
.lg-submit:hover i { transform: translateX(4px); }
.lg-secure { display: flex; align-items: center; justify-content: center; gap: .4rem; color: var(--muted); font-size: .78rem; margin-top: 1.25rem; }
.lg-mobile-brand { display: flex; align-items: center; justify-content: center; gap: .6rem; color: #fff; font-weight: 800; font-size: 1.15rem; margin-bottom: 1.25rem; }
@media (min-width: 992px) { .lg-mobile-brand { display: none; } }
.login-page .toast-stack { z-index: 1090; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
	html { scroll-behavior: auto; }
}

/* ---------- Print: plain ---------- */
@media print {
	.app-sidebar, .app-aurora, .hero::before, .hero::after { display: none !important; }
	.app-main { margin-left: 0 !important; }
	.admin-table > thead > tr { background: none; }
}

/* The floating top bar shows the page title, so the in-page heading is kept for
   screen readers only; page actions / subtitle stay, an empty head is removed. */
.page-head .page-title { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-head-bare { display: none; }
.page-head { min-height: 0; margin-bottom: 1.25rem; }

/* =====================================================================
   MIDNIGHT & GOLD – palette signature surfaces
   Sapphire (--brand / --brand-2) for actions & navigation, midnight for
   premium surfaces, gold for money, highlights and attention.
   ===================================================================== */
::selection { background: var(--gold-3); color: var(--ink); }

/* Background glow: sapphire + a hint of gold */
.app-aurora::before { background: color-mix(in srgb, var(--brand-2) 18%, transparent); }
.app-aurora::after { background: color-mix(in srgb, var(--gold) 12%, transparent); }

/* Brand mark: midnight tile, gold icon */
.brand-mark { background: var(--grad-lux); color: var(--gold-2); box-shadow: 0 10px 22px -10px rgba(11, 18, 32, .6), inset 0 0 0 1px rgba(251, 191, 36, .35); }

/* Sidebar: gold "you are here" dot, gold group marker */
.app-sidebar .app-menu > li > .nav-link.active:not(.menu-toggle)::after { background: var(--gold); box-shadow: 0 0 0 4px rgba(245, 158, 11, .2); }
.app-sidebar .app-menu .submenu a.active::before { background: var(--grad-gold); }
.app-sidebar .nav-badge:hover { background: var(--midnight); color: var(--gold-2); }

/* Sidebar spotlight card: midnight with a gold edge */
.sb-spot { background: radial-gradient(180px 120px at 100% 0%, rgba(245, 158, 11, .28), transparent 70%), var(--grad-lux); border: 1px solid rgba(251, 191, 36, .35); box-shadow: 0 18px 32px -18px rgba(11, 18, 32, .7); }
.sb-spot:hover { box-shadow: 0 22px 38px -18px rgba(11, 18, 32, .75), 0 0 0 1px rgba(251, 191, 36, .5); }
.sb-spot::after { border-color: rgba(251, 191, 36, .12); }
.sb-spot-icon { background: var(--grad-gold); border: 0; color: #3b2300; box-shadow: 0 8px 16px -8px rgba(245, 158, 11, .8); }
.sb-spot-value { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sb-spot-note { border-top-color: rgba(251, 191, 36, .2); }
body.sb-collapsed .sb-spot-icon { background: transparent; color: var(--gold-2); box-shadow: none; }

/* Top bar: Create button stays sapphire; loader in gold */
.page-loader { background: var(--grad-gold); box-shadow: 0 0 12px rgba(245, 158, 11, .6); }

/* Hero banners (dashboards): midnight → sapphire with a gold glow; money in gold */
.hero {
	background:
		radial-gradient(560px 300px at 100% 0%, rgba(245, 158, 11, .26), transparent 60%),
		radial-gradient(520px 340px at 0% 100%, color-mix(in srgb, var(--brand-2) 55%, transparent), transparent 65%),
		var(--grad-lux);
	box-shadow: 0 30px 60px -30px rgba(11, 18, 32, .65);
}
.hero::after { border-color: rgba(251, 191, 36, .1); }
.hero-eyebrow { border-color: rgba(251, 191, 36, .35); }
.hero-eyebrow i { color: var(--gold-2); }
.hero-panel { border-color: rgba(251, 191, 36, .28); background: rgba(255, 255, 255, .08); }
.hero-panel-label i { color: var(--gold-2); }
.hero-amount { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-split { border-top-color: rgba(251, 191, 36, .2); }
.btn-hero { background: var(--grad-gold); color: #2a1800; box-shadow: 0 14px 28px -12px rgba(245, 158, 11, .75); }
.btn-hero:hover { background: var(--grad-gold); color: #2a1800; box-shadow: 0 18px 32px -12px rgba(245, 158, 11, .85); }
.hero-user .avatar { box-shadow: 0 0 0 3px rgba(251, 191, 36, .55); }

/* Cards & prices: sapphire → gold accent stripe */
.pc-card::before { background: linear-gradient(90deg, var(--brand), var(--brand-2) 55%, var(--gold)); }
.price-card.featured { box-shadow: 0 0 0 2px var(--gold), 0 24px 50px -20px rgba(245, 158, 11, .45); }
.dash-top-amt { background: var(--gold-50); color: var(--gold-ink); }
.est-comm { background: var(--gold-50); color: var(--gold-ink); border-color: var(--gold-3); }

/* Level chips: L1 sapphire, L2 gold, L3 sky, L4 emerald */
.mp-lv-1, .pc-lv-1, .pl-r1 { background: var(--grad); color: #fff; }
.mp-lv-2, .pc-lv-2, .pl-r2 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.mp-lv-3, .pc-lv-3, .pl-r3 { background: #e0f2fe; color: #0369a1; }
.mp-lv-4, .pc-lv-4, .pl-r4 { background: #d1fae5; color: #047857; }

/* Pending = gold everywhere */
.mp-pending { background: var(--gold-50); color: var(--gold-ink); box-shadow: inset 0 0 0 1px var(--gold-3); }
button.mp-pending:hover { background: var(--gold-3); }
.mp-summary.is-on { border-color: var(--gold); background: var(--gold-50); }
.mp-summary-note { color: var(--gold-ink); }
.po-pending-card { border-color: var(--gold-3); background: linear-gradient(120deg, var(--gold-50), #fff 60%); box-shadow: inset 5px 0 0 var(--gold), var(--shadow-sm); }
.po-pending-title, .po-pending-count, .po-pending-go { color: var(--gold-ink); }
.po-pending { background: var(--gold-50); color: var(--gold-ink); }
.mp-req-row > td { background: #fffdf5 !important; }
.mp-reqs { border-left-color: var(--gold); }
.mp-cards .mp-reqs { background: #fffdf5; }
.mp-reqs-title { color: var(--gold-ink); }
.mp-req { border-top-color: var(--gold-3); }
.pc-table tr.pc-me td { background: var(--gold-50); }
.pc-table tr.pc-me td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.pc-you { background: var(--gold-3); color: var(--gold-ink); }

/* Login: midnight canvas, sapphire + gold light */
body.login-page, .lg-bg { background-color: var(--midnight); }
.lg-bg { background: radial-gradient(1200px 700px at 80% -10%, color-mix(in srgb, var(--brand-2) 32%, transparent), transparent 60%), var(--midnight); }
.lg-blob.b1 { background: var(--brand-2); opacity: .5; }
.lg-blob.b2 { background: var(--gold); opacity: .28; }
.lg-blob.b3 { background: var(--brand); opacity: .55; }
.lg-kicker { border-color: rgba(251, 191, 36, .3); }
.lg-card { border-color: rgba(251, 191, 36, .18); }
.lg-card .val { color: #fff; }
.lg-card.c2 .val { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lg-card.c2 .val .up { -webkit-text-fill-color: #34d399; }
.lg-card-form .brand-mark-lg { box-shadow: 0 16px 30px -14px rgba(11, 18, 32, .7), inset 0 0 0 1px rgba(251, 191, 36, .4); }
.lg-pill { background: var(--gold-50); color: var(--gold-ink); }

/* =====================================================================
   SIDEBAR – Midnight & Gold (dark panel on the light page)
   Text #c7d0e4 / labels #7c89a8 on midnight: AA contrast. Sapphire marks
   the active page, gold marks highlights (dot, sub-item, badges, money).
   ===================================================================== */
.app-sidebar {
	--sb-text: #c7d0e4; --sb-muted: #8b97b5; --sb-dim: #7c89a8;
	--sb-hover: rgba(255, 255, 255, .06); --sb-line: rgba(255, 255, 255, .08);
}
.app-sidebar .sb-inner {
	color: var(--sb-text);
	background:
		radial-gradient(260px 200px at 110% -6%, rgba(245, 158, 11, .16), transparent 70%),
		radial-gradient(320px 260px at -20% 105%, color-mix(in srgb, var(--brand-2) 34%, transparent), transparent 70%),
		linear-gradient(180deg, #0b1220 0%, #0f1a36 100%);
	border-color: var(--sb-line);
	box-shadow: 0 24px 50px -24px rgba(11, 18, 32, .7);
}
.app-sidebar .sb-inner::before { background: radial-gradient(circle, color-mix(in srgb, var(--brand-2) 30%, transparent), transparent 70%); }
.app-sidebar .sb-inner::after { content: ""; position: absolute; left: 1.25rem; right: 1.25rem; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(251, 191, 36, .55), transparent); pointer-events: none; }
.app-sidebar :focus-visible { outline-color: var(--gold-2); }
.app-sidebar .sb-body { scrollbar-color: rgba(255, 255, 255, .16) transparent; }
.app-sidebar .sb-body::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, .16); }

/* Brand */
.app-sidebar .sb-brand .brand-name { color: #fff; }
.app-sidebar .sb-brand .brand-sub { color: var(--sb-muted); }
.app-sidebar .brand-mark { background: var(--grad-gold); color: var(--midnight); box-shadow: 0 10px 22px -10px rgba(245, 158, 11, .7), inset 0 1px 0 rgba(255, 255, 255, .45); }
.app-sidebar .sb-collapse, .app-sidebar .sb-close { color: var(--sb-muted); }
.app-sidebar .sb-close { background: var(--sb-hover); }
.app-sidebar .sb-collapse:hover, .app-sidebar .sb-close:hover { background: rgba(255, 255, 255, .1); color: var(--gold-2); }

/* Search */
.app-sidebar .sb-search { background: rgba(255, 255, 255, .05); border-color: var(--sb-line); color: var(--sb-muted); }
.app-sidebar .sb-search:hover { background: rgba(255, 255, 255, .08); border-color: rgba(251, 191, 36, .45); color: #fff; box-shadow: 0 0 0 4px rgba(245, 158, 11, .1); }
.app-sidebar .sb-search kbd { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); color: var(--sb-muted); box-shadow: none; }

/* Section labels */
.app-sidebar .sb-label { color: var(--sb-dim); }

/* Menu items */
.app-sidebar .app-menu .nav-link { color: var(--sb-text); }
.app-sidebar .nl-icon { background: rgba(255, 255, 255, .06); color: #a9b6d6; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04); }
.app-sidebar .app-menu .nav-link:hover { background: var(--sb-hover); color: #fff; }
.app-sidebar .app-menu .nav-link:hover .nl-icon { background: color-mix(in srgb, var(--brand-2) 30%, transparent); color: #fff; }
.app-sidebar .app-menu .nav-link.active { background: linear-gradient(90deg, color-mix(in srgb, var(--brand-2) 34%, transparent), color-mix(in srgb, var(--brand-2) 6%, transparent)); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-2) 30%, transparent); }
.app-sidebar .app-menu .nav-link.active .nl-icon { background: linear-gradient(135deg, var(--brand-2), color-mix(in srgb, var(--brand-2) 60%, #60a5fa)); color: #fff; box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--brand-2) 80%, transparent); }
.app-sidebar .app-menu > li > .nav-link.active:not(.menu-toggle)::after { background: var(--gold-2); box-shadow: 0 0 0 4px rgba(251, 191, 36, .18), 0 0 12px rgba(251, 191, 36, .6); }
.app-sidebar .app-menu .menu-toggle::after { color: var(--sb-dim); }
.app-sidebar .app-menu .menu-toggle[aria-expanded="true"]:not(.active) { color: #fff; }
.app-sidebar .app-menu .menu-toggle[aria-expanded="true"]::after { color: var(--gold-2); }

/* Sub-menu */
.app-sidebar .app-menu .submenu { border-left-color: var(--sb-line); }
.app-sidebar .app-menu .submenu a { color: #9aa6c4; }
.app-sidebar .app-menu .submenu a > i { color: var(--sb-dim); }
.app-sidebar .app-menu .submenu a:hover { background: var(--sb-hover); color: #fff; }
.app-sidebar .app-menu .submenu a:hover > i { color: var(--gold-2); }
.app-sidebar .app-menu .submenu a.active { background: rgba(245, 158, 11, .12); color: var(--gold-3); }
.app-sidebar .app-menu .submenu a.active > i { color: var(--gold-2); }
.app-sidebar .app-menu .submenu .divider { background: var(--sb-line); }

/* Spotlight card: gold-edged glass on the dark panel */
.app-sidebar .sb-spot { background: radial-gradient(180px 120px at 100% 0%, rgba(245, 158, 11, .3), transparent 70%), linear-gradient(135deg, color-mix(in srgb, var(--brand-2) 38%, transparent), rgba(255, 255, 255, .04)); border: 1px solid rgba(251, 191, 36, .38); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.app-sidebar .sb-spot:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(251, 191, 36, .55), 0 16px 30px -18px rgba(245, 158, 11, .6); }
.app-sidebar .sb-spot-label { color: var(--sb-muted); }

/* User card */
.app-sidebar .sb-user { background: rgba(255, 255, 255, .05); border-color: var(--sb-line); color: #fff; }
.app-sidebar .sb-user .avatar { box-shadow: 0 0 0 2px rgba(251, 191, 36, .5); }
.app-sidebar .sb-user-sub { color: var(--sb-muted); }
.app-sidebar .sb-logout { color: var(--sb-muted); }
.app-sidebar .sb-logout:hover { background: rgba(239, 68, 68, .16); color: #fca5a5; }

/* Collapsed rail: dark flyouts, gold-edged tooltips */
@media (min-width: 1200px) {
	body.sb-collapsed .app-sidebar .sb-label span { background: var(--sb-line); }
	body.sb-collapsed .app-sidebar .app-menu .submenu { background: #0f1a36; border-color: rgba(255, 255, 255, .1); box-shadow: 0 24px 50px -20px rgba(11, 18, 32, .75); }
	body.sb-collapsed .app-sidebar .app-menu .submenu-title { color: var(--sb-dim); }
	body.sb-collapsed .app-sidebar .app-menu > li:not(.has-sub) > .nav-link:hover::before { background: var(--midnight); box-shadow: 0 0 0 1px rgba(251, 191, 36, .35), var(--shadow); }
	body.sb-collapsed .app-sidebar .sb-spot { background: rgba(245, 158, 11, .14); }
}
/* The drawer itself receives focus when opened: no outline around the whole panel */
.app-sidebar:focus, .app-sidebar:focus-visible { outline: none; }

/* =====================================================================
   INTEGRATED SHELL – sidebar and top bar attached to the page edges
   No floating gaps or rounded outer corners. The sidebar's logo row is
   exactly as tall as the top bar, so their bottom edges form one line;
   the top bar uses the same side padding as the content, so the
   breadcrumb lines up with the content below.
   ===================================================================== */
:root { --gap: 0px; --sb-w: 264px; --sb-rail: 80px; --nav-h: 60px; --bottom-h: 64px; --pad: .75rem; }
@media (min-width: 576px) { :root { --pad: 1rem; } }
@media (min-width: 768px) { :root { --pad: 1.5rem; } }
@media (min-width: 1200px) { :root { --gap: 0px; --nav-h: 68px; --pad: 2rem; } }
@media (min-width: 1800px) { :root { --pad: 2.5rem; } }

/* ---- Sidebar: full height, flush left, one edge line ---- */
.app-sidebar .sb-inner { border-radius: 0 !important; border: 0; border-right: 1px solid rgba(255, 255, 255, .06); box-shadow: 4px 0 24px -16px rgba(11, 18, 32, .45); }
.sb-head { height: var(--nav-h); padding: 0 .75rem 0 1.15rem; border-bottom: 1px solid rgba(255, 255, 255, .07); flex: none; }
.app-sidebar .sb-inner::after { left: 0; right: 0; }
.sb-search { margin: .9rem .85rem .35rem; }
.sb-foot { border-top: 1px solid rgba(255, 255, 255, .06); padding: .8rem .75rem; }
@media (max-width: 1199.98px) {
	.app-sidebar { --bs-offcanvas-width: 288px; }
	.sb-head { height: calc(var(--nav-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
	.sb-foot { padding-bottom: calc(.8rem + env(safe-area-inset-bottom)); }
}

/* Collapsed rail: logo row keeps the bar height; expand button sits on the edge */
@media (min-width: 1200px) {
	body.sb-collapsed .sb-head { flex-direction: row; justify-content: center; height: var(--nav-h); padding: 0; gap: 0; }
	body.sb-collapsed .sb-collapse { position: absolute; right: -13px; top: calc(var(--nav-h) - 13px); z-index: 3; width: 26px; height: 26px; border-radius: 50%; font-size: .75rem; background: var(--midnight); color: var(--gold-2); border: 1px solid rgba(251, 191, 36, .45); box-shadow: 0 4px 10px rgba(11, 18, 32, .35); }
	body.sb-collapsed .sb-collapse:hover { background: var(--brand-2); color: #fff; }
	body.sb-collapsed .sb-search { margin: .9rem auto .35rem; }
	body.sb-collapsed .app-nav .app-bar { padding-left: calc(var(--pad) + 6px); }
}

/* ---- Top bar: flush top, full width beside the sidebar ---- */
.app-nav { top: 0; left: 0; right: 0; height: calc(var(--nav-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); border-radius: 0; border: 0; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .88); box-shadow: 0 1px 0 rgba(11, 18, 32, .02), 0 8px 24px -22px rgba(11, 18, 32, .35); }
@media (min-width: 1200px) {
	.app-nav { left: var(--sb-w); }
	body.sb-collapsed .app-nav { left: var(--sb-rail); }
}
.app-bar { height: var(--nav-h); padding: 0 calc(var(--pad) - .35rem); gap: .5rem; }
@media (min-width: 1200px) { .app-bar { padding: 0 var(--pad); } }
.nb-search { height: 40px; }
.nb-create, .btn-icon { height: 40px; }
.btn-icon { width: 40px; }
.nb-user { height: 42px; }

/* ---- Content: same side padding as the bar, full width ---- */
.content { max-width: none; padding: calc(var(--nav-h) + env(safe-area-inset-top) + 1.25rem) var(--pad) calc(var(--bottom-h) + env(safe-area-inset-bottom) + 1.25rem); }
@media (min-width: 1200px) {
	.app-main { margin-left: var(--sb-w); }
	body.sb-collapsed .app-main { margin-left: var(--sb-rail); }
	.content { padding: calc(var(--nav-h) + 1.75rem) var(--pad) 2.5rem; }
}
.toast-stack { top: calc(var(--nav-h) + env(safe-area-inset-top) + .75rem); }

/* ---- Phones / tablets: bottom bar flush with the screen edge ---- */
@media (max-width: 1199.98px) {
	.bottom-nav { left: 0; right: 0; bottom: 0; height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-radius: 0; border: 0; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .94); box-shadow: 0 -8px 24px -20px rgba(11, 18, 32, .4); }
	.bottom-nav a.active::before { top: 0; bottom: auto; left: 32%; right: 32%; width: auto; height: 3px; border-radius: 0 0 3px 3px; transform: none; background: var(--grad-gold); }
	.bottom-nav a.active i { transform: none; }
	.fab-float { bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 16px); right: var(--pad); }
	.sticky-actions { bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
}

/* =====================================================================
   TYPE SCALE – slightly smaller text everywhere (about 6%)
   Every rem-based size (headings, body, menu, buttons, labels, badges,
   spacing) follows the root size, so proportions stay the same.
   Phone form fields keep 16px on purpose: smaller makes iPhones zoom in.
   ===================================================================== */
html { font-size: 15px; }                                  /* was the browser default 16px */
@media (max-width: 575.98px) { body.portal { font-size: 14px; } }   /* was 15px */
.btn.action-btn, .btn.action-btn i { font-size: 14px; }   /* was 15px */
.admin-table .mt-avatar { font-size: 12px; }               /* was 13px */
.sb-avatar { font-size: 12px; }
.tree-node .name { font-size: 12px; }
.tree-node .meta { font-size: 10px; }

/* =====================================================================
   DENSITY – less empty space, same rhythm
   Spacing is reduced about 15–25% on every shared building block, so all
   pages tighten together. The top bar keeps using --pad, so it stays
   aligned with the content.
   ===================================================================== */
:root { --pad: .75rem; }
@media (min-width: 576px) { :root { --pad: .9rem; } }
@media (min-width: 768px) { :root { --pad: 1.25rem; } }
@media (min-width: 1200px) { :root { --pad: 1.5rem; } }
@media (min-width: 1800px) { :root { --pad: 2rem; } }

/* Page frame */
.content { padding-top: calc(var(--nav-h) + env(safe-area-inset-top) + .9rem); padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 1rem); }
@media (min-width: 1200px) { .content { padding: calc(var(--nav-h) + 1.2rem) var(--pad) 1.75rem; } }
.page-head { margin-bottom: .9rem; gap: .6rem; }
.content .g-3, .content .row.g-3 { --bs-gutter-x: .875rem; --bs-gutter-y: .875rem; }
.content .g-2, .content .row.g-2 { --bs-gutter-x: .6rem; --bs-gutter-y: .6rem; }
.content .mb-3 { margin-bottom: .875rem !important; }
.content .mb-4 { margin-bottom: 1.15rem !important; }
.content .mt-4 { margin-top: 1.15rem !important; }
.section-title { margin: 1.4rem 0 .7rem; }

/* Cards */
.card-header { padding: .8rem 1.1rem; }
.card-body { padding: 1.05rem 1.1rem; }
.card-footer { padding: .65rem 1.1rem; }
.stat { padding: .95rem 1.05rem; gap: .85rem; }
.stat-icon { width: 44px; height: 44px; border-radius: 13px; font-size: 1.15rem; }
.form-section { margin-bottom: .85rem; }
.form-section i { width: 32px; height: 32px; }
.sticky-actions { padding-top: .9rem; }
.dl-grid { gap: .4rem .85rem; }
.timeline li { padding-bottom: .8rem; }
.alert { padding: .75rem .95rem; }

/* Dashboards */
.hero { padding: 1.35rem; gap: 1.1rem; margin-bottom: 1.1rem; border-radius: 22px; }
@media (min-width: 992px) { .hero { padding: 1.6rem 1.9rem; } }
.hero-title { margin: .65rem 0 .35rem; }
.hero-sub { margin-bottom: 1rem; }
.hero-panel { padding: 1.1rem 1.2rem; border-radius: 18px; }
.hero-amount { margin: .25rem 0 .1rem; }
.hero-split { margin-top: .85rem; padding-top: .85rem; }
.dash-card { padding: 1.1rem 1.2rem; }
.dash-icon { width: 44px; height: 44px; border-radius: 13px; font-size: 1.15rem; margin-bottom: .75rem; }
.dash-trend { margin-top: .4rem; }
.dash-card-title { margin-bottom: .75rem; }
.dash-chart { height: 280px; }
.dash-top li { padding: .65rem .5rem; }
.quick-link { padding: .8rem .95rem; gap: .75rem; }
.quick-link .ql-icon { width: 40px; height: 40px; }

/* Lists, tables, filters */
.filter-bar { padding: .8rem; margin-bottom: .85rem; }
.mp-summary { padding: .85rem 1.05rem; margin-bottom: .85rem; }
.mp-summary-icon { width: 40px; height: 40px; }
.mp-tabs { margin-bottom: .8rem; }
.mp-tab { min-height: 38px; padding: .4rem .85rem; }
.mp-list-head { padding: .8rem 1rem; }
.table > :not(caption) > * > * { padding: .65rem .85rem; }
.mp-table > thead > tr > th, .mp-table > tbody > tr > td { padding-top: .65rem; padding-bottom: .65rem; }
.admin-table > thead > tr > th { padding: .75rem .85rem; }
.admin-table > tbody > tr > td, .admin-table > tfoot > tr > td { padding: .7rem .85rem; }
.pl-table > thead > tr > th { padding: .7rem 1rem; }
.pl-table > tbody > tr > td, .pl-table > tfoot > tr > td { padding: .7rem 1rem; }
.mp-foot { padding: .65rem 1rem; }
.mp-cards { padding: .6rem; gap: .6rem; }
.mp-card { padding: .8rem; }
.mp-empty, .pl-empty, .empty-state, .dash-empty { padding: 1.75rem 1rem; }
.mp-tree-bar { padding: .7rem 1rem; }

/* Plans, settings, payouts */
.pc-grid { gap: .875rem; }
.pc-card { padding: 1.1rem; gap: .7rem; }
.pc-note, .gs-note { padding: .6rem .85rem; margin-bottom: .85rem; }
.pl-box-head { padding: .8rem 1rem; }
.pl-note { padding: .7rem 1rem; }
.pl-svc-summary { margin: .8rem 1rem; }
.gs-card { padding: 1.05rem 1.15rem; margin-bottom: .85rem; }
.gs-title { margin-bottom: .8rem; }
.gs-sub { margin: 1.1rem 0 .65rem; padding-top: .9rem; }
.gs-card-actions { margin-top: 1rem; padding-top: .85rem; }
.po-pending-card { padding: .9rem 1.1rem; margin-bottom: .85rem; }
.po-pending-icon { width: 46px; height: 46px; }
.po-sum { padding: .9rem 1.05rem; }
.po-sum-icon { width: 42px; height: 42px; }
.po-filters { padding: .65rem; }

/* Sidebar */
.sb-search { margin: .75rem .85rem .2rem; height: 40px; }
.app-sidebar .sb-label { padding: .75rem .6rem .3rem; }
.app-sidebar .sb-label:first-child { padding-top: .35rem; }
.app-sidebar .app-menu .nav-link { min-height: 42px; padding: .32rem .5rem; gap: .65rem; }
.app-sidebar .nl-icon { width: 32px; height: 32px; border-radius: 10px; }
.app-sidebar .app-menu .submenu { margin: .05rem 0 .25rem 1.55rem; }
.app-sidebar .app-menu .submenu a { min-height: 34px; padding: .32rem .6rem; }
.sb-foot { padding: .65rem .7rem; gap: .5rem; }
.sb-spot { padding: .75rem .85rem; }
.sb-spot-note { margin-top: .45rem; padding-top: .45rem; }
.sb-user { padding: .45rem .5rem; }

/* Dialogs & login */
.modal-header { padding: .9rem 1.15rem; }
.modal-body { padding: 1rem 1.15rem; }
.lg-hero { padding: 2.5rem 3rem; }
.lg-preview { margin-top: 1.75rem; }
.lg-card-form { padding: 2rem 1.75rem 1.6rem; }
.lg-field { margin-bottom: .85rem; }
/* Members list: long headings wrap, slimmer cell sides – the table fits without sideways scrolling */
.mp-table > thead > tr > th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
.mp-table > thead > tr > th, .mp-table > tbody > tr > td { padding-left: .6rem; padding-right: .6rem; }
.mp-table > thead > tr > th:first-child, .mp-table > tbody > tr > td:first-child { padding-left: 1rem; }
.mp-table > thead > tr > th:last-child, .mp-table > tbody > tr > td:last-child { padding-right: 1rem; }
.mp-table .action-btns { gap: 4px; }

/* Page buttons shown in the top bar (desktop) – compact, aligned with the bar controls */
.nb-page-actions { display: flex; align-items: center; gap: .4rem; margin-left: 1.1rem; padding-left: 1.1rem; border-left: 1px solid var(--line); min-width: 0; flex: 0 1 auto; flex-wrap: nowrap; }
.nb-page-actions:empty { display: none; }
.nb-page-actions .page-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: nowrap; }
.nb-page-actions .btn { height: 36px; min-height: 36px; padding: 0 .8rem; font-size: .8rem; border-radius: 11px; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.nb-page-actions form { margin: 0; }
.nb-page-actions .mp-toggle { padding: 3px; border-radius: 12px; }
.nb-page-actions .mp-toggle button { min-height: 28px; padding: .2rem .65rem; font-size: .8rem; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.page-head.is-empty { margin: 0; min-height: 0; height: 0; padding: 0; overflow: hidden; }

/* Settings: full width; on large screens General | Payment side by side, Save under Payment */
.gs { max-width: none; }
@media (min-width: 1200px) {
	.gs { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 0 .875rem; align-items: start; }
	.gs > .gs-card:first-of-type { grid-row: span 3; }
	.gs > .gs-actions { justify-content: stretch; margin-top: 0; }
	.gs > .gs-actions .btn { width: 100%; }
}

/* =====================================================================
   CONTENT START – gap between the top bar and the first content
   Desktop 12px, phones/tablets 10px (was 18px / ~14px). The page-load
   animation no longer slides the content down, so the gap never looks
   bigger while a page opens.
   ===================================================================== */
:root { --content-top: 10px; }
@media (min-width: 1200px) { :root { --content-top: 12px; } }
.content { padding-top: calc(var(--nav-h) + env(safe-area-inset-top) + var(--content-top)); }
@media (min-width: 1200px) { .content { padding-top: calc(var(--nav-h) + var(--content-top)); } }
/* a page head that only holds a subtitle / phone buttons sits close to the bar too */
.content > .page-head:first-child { margin-top: 0; }
/* page / card entrance: fade with a tiny lift (was 10–14px) */
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
/* Single-page lists render no pager: drop the then-empty footer / wrapper */
.card-footer:empty, .content .mt-3:empty { display: none; }

/* =====================================================================
   TABLES – one standard for every table on the website
   (.table, .admin-table, .mp-table, .pl-table, member tables, reports)
   · same header, row height, padding, borders and hover
   · first / last column inset = card padding, so table text lines up
     with the card title above it
   · numbers right-aligned with even-width digits (columns set by
     portal.js alignTables)
   · tables run edge-to-edge inside their card: no inner gaps
   ===================================================================== */
:root { --t-x: .85rem; --t-y: .68rem; --t-edge: 1.1rem; }

.content .table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: .875rem; color: var(--ink); --bs-table-bg: transparent; --bs-table-hover-bg: var(--brand-25); --bs-table-striped-bg: transparent; }

/* Header */
.content .table > thead > tr { background: var(--brand-25); }
.content .table > thead > tr > th {
	padding: .7rem var(--t-x); background: var(--brand-25); color: var(--muted);
	font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; line-height: 1.3;
	white-space: normal; vertical-align: bottom; text-align: left; border-bottom: 1px solid var(--line); border-top: 0;
}
.content .table > thead > tr > th a { color: var(--muted) !important; }

/* Body */
.content .table > tbody > tr > td, .content .table > tbody > tr > th {
	padding: var(--t-y) var(--t-x); vertical-align: middle; border-bottom: 1px solid var(--line-2); border-top: 0;
	background-color: transparent; box-shadow: none; font-size: .875rem;
}
.content .table > tbody > tr:last-child > td, .content .table > tbody > tr:last-child > th { border-bottom: 0; }
.content .table > tbody > tr:nth-child(even) > td { background-color: transparent; }    /* no zebra stripes: hover only */
.content .table > tbody > tr:hover > td, .content .table > tbody > tr:hover > th { background-color: var(--brand-25); }
.content .table > tbody > tr > td[colspan] { padding: 1.6rem var(--t-x); }            /* "No records" rows */

/* Footer (totals) */
.content .table > tfoot > tr > td, .content .table > tfoot > tr > th { padding: .7rem var(--t-x); background: var(--brand-25); font-weight: 800; border-top: 1px solid var(--line); border-bottom: 0; }

/* Edge alignment with the card padding */
.content .table > * > tr > :first-child { padding-left: var(--t-edge); }
.content .table > * > tr > :last-child { padding-right: var(--t-edge); }

/* Compact tables (reports with many columns) keep the same rhythm, slightly tighter */
.content .table-sm > thead > tr > th { padding-top: .6rem; padding-bottom: .6rem; }
.content .table-sm > tbody > tr > td { padding-top: .55rem; padding-bottom: .55rem; font-size: .84rem; }

/* Alignment */
.content .table .num, .content .table th.num, .content .table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.content .table .text-end { text-align: right; }
.content .table td:last-child:has(.btn, .action-btns, form) { width: 1%; white-space: nowrap; text-align: right; }
.content .table td .action-btns { justify-content: flex-end; }
.content .table td.text-center, .content .table th.text-center { text-align: center; }

/* Tables fit their card: edge to edge, rounded by the card, no inner gaps */
.content .card:has(.table) { overflow: hidden; }
.content .card > .table-responsive, .content .mp-panel .table-responsive, .content .pl-box .table-responsive { border-radius: 0; margin: 0; }
.content .card-body:has(> .table-responsive:only-child), .content .card-body:has(> .table:only-child) { padding: 0; }
.content .card-body > .table-responsive:not(:only-child) { margin-left: -1.1rem; margin-right: -1.1rem; width: auto; }
.content .card-body > .table-responsive:not(:only-child):last-child { margin-bottom: -1.05rem; }
.content .card-header + .table-responsive > .table > thead > tr > th,
.content .mp-list-head + .table-responsive > .table > thead > tr > th { border-top: 0; }
.content .table-responsive { scrollbar-width: thin; }
.content .card > .table-responsive:last-child > .table > tbody > tr:last-child > td { border-bottom: 0; }

/* Small tables inside cards (plan card commission table, specs) keep their own compact look */
.content .pc-table th, .content .pc-table td { padding-left: .65rem; padding-right: .65rem; }
.content .spec-table > tbody > tr > th { text-transform: none; letter-spacing: 0; font-size: .84rem; font-weight: 500; }

/* Phones: tables that turn into cards keep the same spacing language */
@media screen and (max-width: 767.98px) {
	.content .table-cards > tbody > tr, .content .table-cards > tfoot > tr { margin: .55rem .6rem; padding: .5rem .85rem; border-radius: 14px; border-color: var(--line); }
	.content .table-cards > * > tr > td, .content .table-cards > * > tr > th { padding: .38rem 0 !important; }
	.content .table-cards > tbody > tr:last-child { margin-bottom: .6rem; }
}
/* Short cell values on one line (set by alignTables) – rows keep an even height */
.content .table td.nw, .content .table td.nw .mt-branch, .content .table td.nw .mt-service, .content .table td.nw .at-name-body { white-space: nowrap; }

/* ---------- Add Member: two-part form (Member details / Client details) ---------- */
.am-steps { display: flex; flex-direction: row; align-items: center; gap: .75rem; padding: .7rem .9rem; position: sticky; top: calc(var(--nav-h, 60px) + .5rem); z-index: 6; }
.am-step { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--muted); min-width: 0; padding: .25rem .4rem; border-radius: 12px; transition: background .15s, color .15s; }
.am-step:hover { background: var(--grad-soft, #f1f4fb); color: var(--ink); }
.am-step b { display: block; font-size: .88rem; color: inherit; line-height: 1.2; }
.am-step small { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-step.is-on { color: var(--ink); }
.am-step.is-off { opacity: .55; }
.am-line { flex: 1 1 auto; height: 2px; min-width: 1.5rem; border-radius: 2px; background: var(--line); }
.am-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: #fff; color: var(--muted); border: 2px solid var(--line); transition: all .15s; }
.am-step.is-on .am-num, .am-part-head .am-num { background: var(--grad, var(--brand)); color: #fff; box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 60%, transparent); }
.am-part { scroll-margin-top: calc(var(--nav-h, 60px) + 5.5rem); }
.am-part + .am-part { margin-top: 1.6rem; }
.am-part-head { display: flex; align-items: center; gap: .75rem; margin: 0 0 .8rem; padding-bottom: .7rem; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.am-part-head h2 { font-size: 1.08rem; font-weight: 800; margin: 0; letter-spacing: -.015em; }
.am-part-head p { margin: 0; font-size: .8rem; color: var(--muted); }
.am-part-head .form-switch { padding-left: 3em; }
.am-part-head .form-switch .form-check-input { height: 1.3em; margin-top: .1em; cursor: pointer; }
.am-expected { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 10px; background: var(--grad-soft, #f1f4fb); font-size: .85rem; }
.am-expected b { color: var(--brand); font-size: 1rem; }
@media (max-width: 575.98px) {
	.am-steps { position: static; padding: .55rem .6rem; gap: .4rem; }
	.am-step small { display: none; }
	.am-part-head .form-switch { margin-left: 0 !important; width: 100%; }
}
.am-plan-empty { display: flex; align-items: center; gap: .55rem; min-height: 100%; padding: 1.1rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius, 14px); color: var(--muted); font-size: .86rem; }
.am-plan-empty i { font-size: 1.2rem; color: var(--brand); }
.am-plan-card { max-width: 520px; }
@media (min-width: 992px) { .am-plan-empty { margin-top: 1.75rem; } .am-plan-card { margin-top: 0; } }

/* ---------- Referral: flat commission strip on the plan card ---------- */
.am-flat { display: flex; align-items: center; gap: .7rem; margin-top: .8rem; padding: .7rem .85rem; border-radius: 12px; background: color-mix(in srgb, #059669 9%, #fff); border: 1px solid color-mix(in srgb, #059669 25%, transparent); }
.am-flat > i { font-size: 1.25rem; color: #059669; }
.am-flat > span { flex: 1 1 auto; font-weight: 700; font-size: .86rem; line-height: 1.25; }
.am-flat small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; }
.am-flat b { font-size: 1.15rem; color: #047857; white-space: nowrap; }
.rf-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; }
.rf-item { display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius, 14px); background: #fff; height: 100%; transition: border-color .15s, box-shadow .15s; }
.rf-item:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: 0 6px 18px -12px rgba(15, 23, 42, .35); }
.rf-item.is-on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.rf-name { font-weight: 700; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.rf-price { font-size: 1.15rem; font-weight: 800; color: var(--brand); }
.rf-comm { font-size: .8rem; color: #047857; font-weight: 600; }
.rf-item .btn { margin-top: auto; }

/* ---------- Payout → View: "Paid" action ---------- */
.po-pay-box { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .9rem 0 .4rem; padding: .8rem .9rem; border-radius: 12px; background: color-mix(in srgb, #d97706 8%, #fff); border: 1px solid color-mix(in srgb, #d97706 28%, transparent); }
.po-pay-box > .small { flex: 1 1 220px; }
.po-pay-box .btn { min-width: 110px; }
.po-pay-box.is-done { background: color-mix(in srgb, #059669 8%, #fff); border-color: color-mix(in srgb, #059669 28%, transparent); }

/* Repeat visit of a referred customer (Member → Referral → Repeat visit) */
.rv-box { border-left: 4px solid var(--bs-info, #0dcaf0); }
.rv-cust { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.rv-cust > div { background: var(--bs-tertiary-bg, #f8f9fa); border-radius: .5rem; padding: .6rem .75rem; min-width: 0; }
.rv-cust .rv-k { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color, #6c757d); font-weight: 600; }
.rv-cust b { display: block; overflow-wrap: anywhere; }
.rv-cust small { color: var(--bs-secondary-color, #6c757d); }

/* Member → Add Member: member details + client details in ONE "Member" section */
.am-sub { display: flex; align-items: center; gap: .5rem; font-size: 1rem; font-weight: 700; margin: 0 0 .75rem; }
.am-sub > .bi { color: var(--bs-primary); }
.am-sub-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1.5rem 0 .75rem; padding-top: 1.25rem; border-top: 1px dashed var(--line, #e6e9f2); scroll-margin-top: 90px; }

/* =====================================================================
   Member Portal – mobile pass (phones first)
   ===================================================================== */
@media (max-width: 767.98px) {
	/* Tables shown as cards: the desktop "narrow action column" (width:1%) must not squeeze the card's action row */
	.content .table-cards > * > tr > td:last-child { width: auto !important; }
	.table-cards > * > tr > .td-nolabel { padding-top: .55rem !important; margin-top: .2rem; border-top: 1px dashed var(--line) !important; }
	.table-cards > * > tr > .td-nolabel .btn { min-height: 38px; }

	/* Status / filter tabs: one swipeable row instead of wrapping */
	.nav-pills { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
	.nav-pills::-webkit-scrollbar { display: none; }
	.nav-pills .nav-link { white-space: nowrap; flex: none; }

	/* Team tree: shorter canvas on phones */
	.tree-canvas { height: 52vh; min-height: 320px; }

	/* Client status stepper: smaller steps (it also scrolls to the current step) */
	.stepper .step { flex-basis: 78px; font-size: .68rem; }
}

@media (max-width: 575.98px) {
	/* New Referral: compact rows – name / price / commission on the left, Refer button on the right */
	.rf-cat { grid-template-columns: 1fr; gap: .5rem; }
	.rf-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name btn" "price btn" "comm btn"; column-gap: .75rem; row-gap: .1rem; align-items: center; padding: .65rem .8rem; }
	.rf-item .rf-name { grid-area: name; font-size: .92rem; }
	.rf-item .rf-price { grid-area: price; font-size: 1rem; }
	.rf-item .rf-comm { grid-area: comm; font-size: .75rem; }
	.rf-item > .btn { grid-area: btn; align-self: center; white-space: nowrap; }

	/* Forms: full-width primary actions, comfortable touch targets, no iOS zoom on focus */
	.form-control, .form-select { font-size: 16px; }
	.sticky-actions .btn { min-height: 46px; }
	.am-part-head h2 { font-size: 1.05rem; }
	.am-part-head p { font-size: .8rem; }

	/* Page action buttons next to the title wrap nicely */
	.page-actions, .content-head .btn-toolbar { flex-wrap: wrap; gap: .5rem; }
}

/* =====================================================================
   Team / level tree – responsive (assets/portal/tree.js picks the layout by width)
   ===================================================================== */
.tree-canvas .tree-node .name { font-size: var(--tn-name, 13px); font-weight: 700; }
.tree-canvas .tree-node .meta { font-size: var(--tn-meta, 11px); }
.tree-canvas .tree-node:focus { outline: none; }
.tree-canvas .tree-node:focus-visible .card-bg { stroke: var(--brand); stroke-width: 2.5px; }
.tree-canvas .tree-node .toggle { cursor: pointer; }
.tree-canvas .tree-node .toggle:hover circle { stroke: var(--brand); }
.tree-canvas[data-layout] { transition: height .25s ease; }
/* Compact chart: the box height is set by tree.js to fit the tree (no fixed minimum) */
.tree-canvas[data-layout] { min-height: 0; }
.tree-canvas .tree-node .card-bg { rx: 9; }
.tree-canvas .tree-node .name { font-weight: 700; }
.tree-canvas .tree-node.is-self .card-bg { fill: color-mix(in srgb, var(--brand) 6%, #fff); }
.tree-canvas .tree-node .toggle circle { stroke-width: 1.2px; }
@media (max-width: 767.98px) {
	.tree-toolbar { gap: .5rem; }
	.tree-toolbar .input-group { order: 3; max-width: none !important; flex: 1 1 100%; }
	.tree-toolbar .btn { min-width: 38px; min-height: 34px; }
	.tree-legend { gap: .5rem .8rem; }
}

/* =====================================================================
   Member → Plans: one plan per row (vertical list), responsive
   ===================================================================== */
.mpl-list { display: flex; flex-direction: column; gap: 1rem; }
.mpl-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 210px; gap: 1.25rem 1.5rem; align-items: start; padding: 1.25rem 1.4rem; border: 1px solid var(--line); border-radius: var(--radius, 16px); background: #fff; position: relative; overflow: hidden; }
.mpl-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.mpl-row.is-featured { border-color: color-mix(in srgb, #f59f00 55%, var(--line)); box-shadow: 0 10px 28px -18px rgba(245, 159, 0, .55); }
.mpl-row.is-featured::before { background: linear-gradient(#f59f00, #fbbf24); }
.mpl-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.mpl-no { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--brand-50, #eef2ff); color: var(--brand); flex: none; }
.mpl-name { font-size: 1.1rem; font-weight: 800; margin: 0; }
.mpl-price { font-size: 1.7rem; font-weight: 800; color: var(--brand); line-height: 1.15; margin: .35rem 0 .5rem; }
.mpl-mine { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .3rem; font-size: .85rem; padding: .35rem .65rem; border-radius: 10px; background: #fff8e6; color: #8a5a00; margin-bottom: .75rem; }
.mpl-mine b { font-size: 1rem; color: #6b4500; }
.mpl-mine span { font-size: .75rem; opacity: .85; }
.mpl-features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .3rem .9rem; font-size: .86rem; }
.mpl-features li { display: flex; gap: .35rem; align-items: baseline; min-width: 0; }
.mpl-features .bi { color: #059669; flex: none; }
.mpl-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .35rem; }
.mpl-label .bi { color: var(--brand); }
.mpl-comm .pc-table { width: 100%; font-size: .82rem; }
.mpl-actions { display: flex; flex-direction: column; gap: .5rem; align-self: center; }
.mpl-actions .btn { width: 100%; white-space: nowrap; }

/* Tablet: details + commission side by side, actions in a row underneath */
@media (max-width: 1199.98px) {
	.mpl-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.mpl-actions { grid-column: 1 / -1; flex-direction: row; }
	.mpl-actions .btn { width: auto; flex: 1 1 0; }
}
/* Phone: one column, compact */
@media (max-width: 767.98px) {
	.mpl-list { gap: .75rem; }
	.mpl-row { grid-template-columns: 1fr; gap: .85rem; padding: 1rem 1rem 1rem 1.15rem; }
	.mpl-price { font-size: 1.45rem; margin: .25rem 0 .4rem; }
	.mpl-features { grid-template-columns: 1fr 1fr; font-size: .8rem; gap: .25rem .6rem; }
	.mpl-comm .pc-table { font-size: .78rem; }
	.mpl-actions { flex-direction: column; }
	.mpl-actions .btn { width: 100%; min-height: 44px; }
}
@media (max-width: 359.98px) {
	.mpl-features { grid-template-columns: 1fr; }
}

/* Other Services: admin amount + flat commission (partials/service_flat.php) */
.svc-flat { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.svc-flat-cell { display: flex; flex-direction: column; gap: .1rem; padding: .5rem .7rem; min-width: 0; }
.svc-flat-cell + .svc-flat-cell { border-left: 1px solid var(--line); }
.svc-flat-k { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.svc-flat-cell b { font-size: 1rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.svc-flat-cell b small { font-size: .7rem; font-weight: 600; color: var(--muted); }
.svc-flat-cell > small { font-size: .72rem; color: var(--muted); }
.svc-flat-comm { background: #ecfdf5; }
.svc-flat-comm .svc-flat-k, .svc-flat-comm b { color: #047857; }
.svc-flat-comm.is-none { background: #f8fafc; }
.svc-flat-comm.is-none b, .svc-flat-comm.is-none .svc-flat-k { color: var(--muted); }
.svc-flat-lg .svc-flat-cell { padding: .75rem 1rem; }
.svc-flat-lg .svc-flat-cell b { font-size: 1.3rem; }

/* Member → Profile: view mode details + Edit Profile */
.pf-dl { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: .55rem 1rem; margin: 0; }
.pf-dl dt { font-weight: 600; color: var(--muted); font-size: .85rem; }
.pf-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pf-pre { white-space: pre-line; }
.pf-head-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 575.98px) {
	.pf-head-actions { width: 100%; }
	.pf-head-actions .btn { flex: 1 1 0; min-height: 42px; }
	.pf-dl { grid-template-columns: 1fr; gap: .1rem; }
	.pf-dl dt { margin-top: .5rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
}

/* ==========================================================================
   Member → Dashboard (compact graphical overview)
   ========================================================================== */
.dash2 { --ch-grid: color-mix(in srgb, var(--line) 85%, transparent); --ref: #d97706; }
.dg-bar { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: .8rem 1rem; margin-bottom: 1rem; }
.dg-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .2rem; line-height: 1.2; }
.dg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: .78rem; color: var(--muted); }
.dg-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .5rem; border-radius: 999px; background: var(--brand-50); color: var(--brand-ink); font-weight: 700; }
.dg-actions { display: flex; gap: .4rem; }
.dg-note { font-size: .8rem; color: var(--muted); margin: -.4rem 0 .8rem; }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 992px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; } }
.kpi { position: relative; display: flex; flex-direction: column; min-width: 0; padding: .8rem .9rem 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.kpi-top { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.kpi-icon { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .95rem; color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, #fff); }
.kpi-label { font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: 1.3rem; font-weight: 800; letter-spacing: -.03em; color: var(--ink); margin-top: .45rem; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 576px) { .kpi-value { font-size: 1.45rem; } }
.kpi-sub { font-size: .72rem; color: var(--muted); margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-up, .kpi-down { display: inline-flex; align-items: center; font-weight: 800; }
.kpi-up { color: #047857; }
.kpi-down { color: #be123c; }
.kpi-up .bi, .kpi-down .bi { font-size: 1.05em; margin-right: -.1rem; }
.kpi-spark { display: block; width: calc(100% + 1.8rem); height: 34px; margin: .45rem -.9rem 0; }
.kpi-spark-line { fill: none; stroke: var(--tone); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.kpi-spark-area { fill: color-mix(in srgb, var(--tone) 12%, transparent); }

/* Chart cards */
.ch-card { padding: .9rem 1rem; display: flex; flex-direction: column; }
.ch-head { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .75rem; }
.ch-title { font-weight: 800; font-size: .95rem; letter-spacing: -.01em; color: var(--ink); }
.ch-title .bi { color: var(--brand-2); margin-right: .25rem; }
.ch-sub { font-size: .75rem; color: var(--muted); }
.ch-big { font-size: 1.35rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.ch-link { margin-top: auto; padding-top: .6rem; font-size: .8rem; font-weight: 700; text-decoration: none; }
.ch-range .btn { font-weight: 700; font-size: .72rem; padding: .15rem .55rem; }
.ch-range .btn.active { background: var(--brand); border-color: var(--brand) !important; color: #fff; }
.ch-empty { position: absolute; inset: 0 0 22px 38px; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .35rem; font-size: .8rem; color: var(--muted); padding: 1rem; }
.ch-empty .bi { font-size: 1.4rem; opacity: .6; }
.ch-table { margin-top: .6rem; font-size: .78rem; }
.ch-table summary { color: var(--muted); cursor: pointer; font-weight: 600; width: max-content; }
.ch-table table { font-size: .78rem; margin-top: .4rem; }

/* Monthly commission bars – 6M / 12M switch via data-range */
.ch-card:has(.ec[data-range="12"]) [data-r="6"], .ch-card:has(.ec[data-range="6"]) [data-r="12"] { display: none; }
.ec { position: relative; --ph: 190px; }
.ec[data-range="6"] .ec-old { display: none; }
.ec-plot { position: relative; height: var(--ph); padding-left: 38px; }
.ec-grid { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.ec-gl { position: relative; border-top: 1px dashed var(--ch-grid); height: 0; }
.ec-gl:last-child { border-top: 1px solid var(--line); }
.ec-gl span { position: absolute; left: 0; top: -.5rem; font-size: .66rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ec-bars { position: relative; height: 100%; display: flex; gap: 2px; }
.ec-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; background: none; border: 0; padding: 0; border-radius: 6px; cursor: default; }
.ec-col:hover, .ec-col:focus-visible { background: var(--brand-25); outline: none; }
.ec-bar { position: relative; display: block; width: min(70%, 26px); border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--brand-2) 50%, #fff); transition: height .5s var(--ease), background .15s; height: calc((var(--ph) - 22px) * var(--h12) / 100); }
.ec[data-range="6"] .ec-bar { height: calc((var(--ph) - 22px) * var(--h6) / 100); width: min(50%, 34px); }
.ec-col.is-current .ec-bar { background: var(--brand-2); }
.ec-col:hover .ec-bar, .ec-col:focus-visible .ec-bar { background: var(--brand); }
.ec-val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 3px; font-size: .66rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.ec-x { flex: 0 0 22px; line-height: 22px; font-size: .68rem; color: var(--muted); }
.ec-col.is-current .ec-x { color: var(--ink); font-weight: 700; }
@media (max-width: 575.98px) {
	.ec { --ph: 160px; }
	.ec[data-range="12"] .ec-col:nth-child(odd) .ec-x { visibility: hidden; }
}

/* Referral growth line */
.rg { position: relative; height: 150px; margin-bottom: .2rem; }
.rg-plot { position: absolute; inset: 6px 0 22px 0; }
.rg-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rg-gl { stroke: var(--ch-grid); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.rg-base { stroke: var(--line); vector-effect: non-scaling-stroke; }
.rg-area { fill: color-mix(in srgb, var(--ref) 13%, transparent); }
.rg-line { fill: none; stroke: var(--ref); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.rg-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--ref); box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.rg-dot.is-current { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
.rg-hits { position: absolute; top: 0; bottom: 0; left: -5.2%; right: -5.2%; display: flex; }
.rg-hit { flex: 1 1 0; min-width: 0; background: none; border: 0; padding: 0; display: flex; align-items: flex-end; justify-content: center; border-radius: 6px; cursor: default; }
.rg-hit span { line-height: 22px; font-size: .68rem; color: var(--muted); }
.rg-hit:hover, .rg-hit:focus-visible { background: color-mix(in srgb, var(--ref) 7%, transparent); outline: none; }
.rg-hit:last-child span { color: var(--ink); font-weight: 700; }

/* Clients by status */
.cs-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); margin-bottom: .8rem; }
.cs-bar span { min-width: 6px; outline: none; }
.cs-bar span:hover, .cs-bar span:focus-visible { filter: brightness(1.15); }
.cs-empty { flex: 1; }
.cs-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
@media (min-width: 576px) { .cs-legend { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cs-item { display: flex; align-items: center; gap: .4rem; padding: .4rem .55rem; border-radius: 10px; background: var(--brand-25); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .78rem; min-width: 0; }
.cs-item:hover { border-color: var(--brand-200); color: var(--ink); }
.cs-item i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 3px; }
.cs-item span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-item b { margin-left: auto; font-weight: 800; }

/* Chart tooltip (portal.js) – value first, label second */
.ch-tip { position: fixed; z-index: 1080; pointer-events: none; background: #0b1220; color: #fff; border-radius: 8px; padding: .35rem .6rem; font-size: .74rem; line-height: 1.3; box-shadow: 0 8px 24px -8px rgba(11, 18, 32, .45); transform: translate(-50%, calc(-100% - 8px)); white-space: nowrap; opacity: 0; transition: opacity .12s; }
.ch-tip.show { opacity: 1; }
.ch-tip b { display: block; font-size: .85rem; font-weight: 800; }
.ch-tip small { color: rgba(255, 255, 255, .72); }

@media (max-width: 575.98px) {
	.dg-bar { padding: .7rem .8rem; gap: .65rem; }
	.dg-actions { width: 100%; }
	.dg-actions .btn { flex: 1; }
	.ch-card { padding: .8rem .85rem; }
	.kpi { padding: .7rem .75rem 0; }
	.kpi-spark { width: calc(100% + 1.5rem); margin: .4rem -.75rem 0; height: 28px; }
}
.ch-range .btn, .ch-card .ch-head > .btn-sm { min-height: 0; line-height: 1.4; }
.ch-card .ch-head > .btn-sm { padding: .2rem .65rem; font-size: .78rem; }
.ch-empty.rg-empty { inset: 0 0 40px 0; pointer-events: none; }
.m-list .cl-addr { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* ==========================================================================
   Member Portal – typography (all screen sizes; was phones only)
   One scale for every member page and menu:
     11px   captions · badges · table heads · chart axes · bottom-nav labels
     12px   meta / helper text (.small, .form-text, sub-lines)
     12.5px labels · small buttons
     14px   body · buttons · menu items          (1rem – root is 14px here)
     15px   card / section headings
     17px   page heading · greeting · profile name
     18px   key figures (KPI values)
   Form fields stay 16px on purpose: anything smaller makes iPhones zoom in.
   Font: Plus Jakarta Sans (already loaded) – tabular figures for numbers.
   ========================================================================== */
@media all { /* Member Portal typography – every screen size */
	html.pt-member { font-size: 14px; }
	.portal-member { font-size: 14px; line-height: 1.5; letter-spacing: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

	/* headings */
	.portal-member h1, .portal-member .h1 { font-size: 17px; line-height: 1.25; letter-spacing: -.015em; }
	.portal-member h2, .portal-member .h2, .portal-member h3, .portal-member .h3 { font-size: 15px; line-height: 1.3; letter-spacing: -.01em; }
	.portal-member h4, .portal-member .h4, .portal-member h5, .portal-member .h5 { font-size: 16px; line-height: 1.3; letter-spacing: -.01em; }
	.portal-member h6, .portal-member .h6 { font-size: 14px; line-height: 1.35; }
	.portal-member .pf-head .h5 { font-size: 17px; font-weight: 800; }
	.portal-member .app-bar-title { font-size: 16px; font-weight: 800; letter-spacing: -.015em; }
	.portal-member .dg-title { font-size: 17px; }
	.portal-member .card-header, .portal-member .card-header .fw-semibold { font-size: 15px; font-weight: 700; line-height: 1.3; }
	.portal-member .form-section, .portal-member .am-part-head h2, .portal-member .ch-title { font-size: 15px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
	.portal-member .section-title { font-size: 11px; font-weight: 800; letter-spacing: .08em; }
	.portal-member .empty-state .title { font-size: 15px; }

	/* body copy, meta and helper text */
	.portal-member p { line-height: 1.55; }
	.portal-member .small, .portal-member small { font-size: 12px; line-height: 1.45; }
	.portal-member .small .small, .portal-member .small small, .portal-member small small { font-size: 1em; }
	.portal-member .form-text, .portal-member .ch-sub, .portal-member .kpi-sub, .portal-member .invalid-feedback { font-size: 12px; line-height: 1.4; }
	.portal-member .text-muted { letter-spacing: 0; }

	/* forms */
	.portal-member .form-label { font-size: 12.5px; font-weight: 600; line-height: 1.35; letter-spacing: .005em; margin-bottom: .35rem; }
	.portal-member .form-label small { font-size: 11px; font-weight: 500; }
	.portal-member .form-check-label { font-size: 14px; }
	.portal-member .input-group-text { font-size: 14px; }

	/* buttons */
	.portal-member .btn { font-size: 14px; font-weight: 600; letter-spacing: 0; line-height: 1.35; }
	.portal-member .btn-sm, .portal-member .btn-group-sm > .btn { font-size: 12.5px; }
	.portal-member .ch-range .btn { font-size: 11.5px; }

	/* badges, pills, tables */
	.portal-member .badge { font-size: 11px; font-weight: 700; line-height: 1.15; letter-spacing: .01em; }
	.portal-member .level-pill { font-size: 12px; }
	.portal-member .table { font-size: 13px; }
	.portal-member .table > thead > tr > th, .portal-member .pf-dl dt { font-size: 11px; letter-spacing: .05em; }
	.portal-member .table td .small, .portal-member .table td small { font-size: 12px; }
	.portal-member .m-list .fw-semibold { font-size: 14px; }

	/* KPI tiles + charts */
	.portal-member .kpi-value { font-size: 18px; letter-spacing: -.02em; }
	.portal-member .kpi-label { font-size: 12px; font-weight: 600; }
	.portal-member .ch-big { font-size: 18px; }
	.portal-member .ec-x, .portal-member .ec-gl span, .portal-member .ec-val, .portal-member .rg-hit span { font-size: 11px; }
	.portal-member .num, .portal-member .kpi-value, .portal-member .price { font-variant-numeric: tabular-nums; }

	/* menus: drawer / sidebar, bottom nav, top bar */
	.portal-member .app-sidebar .nl-text { font-size: 14px; font-weight: 600; }
	.portal-member .app-sidebar .app-menu .submenu a { font-size: 13.5px; }
	.portal-member .app-sidebar .sb-label { font-size: 11px; letter-spacing: .1em; }
	.portal-member .app-sidebar .brand-sub, .portal-member .app-sidebar .sb-user-sub, .portal-member .sb-spot-label, .portal-member .sb-spot-note { font-size: 11px; }
	.portal-member .bottom-nav a, .portal-member .bottom-nav button { font-size: 11px; font-weight: 600; letter-spacing: 0; }
	.portal-member kbd { font-size: 11px; }
	.portal-member .dot-badge { font-size: 10px; }
}
@media (max-width: 359.98px) {
	/* very narrow phones */
	.portal-member .kpi-value { font-size: 16px; }
	.portal-member h1, .portal-member .h1, .portal-member .dg-title, .portal-member .pf-head .h5 { font-size: 16px; }
}
@media all { /* Member Portal typography – every screen size */
	/* 11px floor for the remaining small items */
	.portal-member .dg-meta, .portal-member .ch-table summary, .portal-member .am-part-head p { font-size: 12px; }
	.portal-member .ch-card .ch-head > .btn-sm { font-size: 12.5px; }
	.portal-member .tree-legend span, .portal-member .admin-table .mt-pill, .portal-member .level-pill b { font-size: 11px; }
	.portal-member .content .table-sm > tbody > tr > td { font-size: 12.5px; }
}
@media all { /* Member Portal typography – every screen size */
	/* component labels that are sized in rem – keep them at 11px or more */
	.portal-member .stepper .step { font-size: 11px; line-height: 1.3; }
	.portal-member .dl-grid { font-size: 13.5px; }
	.portal-member .dl-grid dt { font-size: 12px; }
	.portal-member .rf-comm { font-size: 11.5px; }
	.portal-member .mpl-no, .portal-member .mpl-mine span, .portal-member .pc-lv, .portal-member .pc-you,
	.portal-member .pc-table th, .portal-member .svc-flat-k, .portal-member .svc-flat small, .portal-member small.from { font-size: 11px; }
	.portal-member .mpl-label { font-size: 12px; }
	.portal-member .mpl-comm .pc-table, .portal-member .pc-table { font-size: 12.5px; }
	.portal-member .mpl-name { font-size: 16px; }
	.portal-member .mpl-price { font-size: 20px; }
	.portal-member .mpl-features { font-size: 12.5px; }
	.portal-member .when { font-size: 11px; }
}
.svc-actions > .btn { margin: 0 !important; }

/* ==========================================================================
   Client entry – Plan / Other Service popups (New Referral)
   ========================================================================== */
.pk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.pk-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 700; padding-top: .6rem; padding-bottom: .6rem; }
.pk-empty { display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: .85rem; background: var(--brand-25); }
.pk-empty.is-invalid { border-color: #dc3545; color: #b02a37; background: #fff5f5; }
.pk-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; font-size: .8rem; font-weight: 700; color: var(--muted); }
.pk-head .bi { color: #059669; }
.pk-chosen { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.pk-chosen li { display: flex; flex-direction: column; padding: .6rem .8rem; border: 1px solid var(--brand-200); border-radius: 12px; background: var(--brand-25); }
.pk-chosen .pk-name { font-weight: 700; color: var(--ink); }
.pk-chosen .pk-meta { font-size: .78rem; color: var(--muted); }

.pk-modal .modal-content { border: 0; border-radius: 18px; }
.pk-modal .modal-header { border-bottom: 1px solid var(--line); padding: .9rem 1.1rem; }
.pk-modal .modal-title { display: flex; align-items: center; gap: .5rem; font-weight: 800; margin: 0; }
.pk-modal .modal-body { padding: .9rem; background: var(--bs-tertiary-bg, #f7f8fc); }
.pk-modal .modal-footer { border-top: 1px solid var(--line); padding: .7rem 1rem; }
.pk-list { display: grid; gap: .55rem; }
.pk-item { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: 0; transition: border-color .15s, box-shadow .15s; }
.pk-item.is-on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.pk-check { cursor: pointer; }
.pk-check .form-check-input { flex: 0 0 auto; width: 1.2rem; height: 1.2rem; margin: 0; }
.pk-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.pk-item .pk-name { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.pk-price { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.pk-comm { font-size: .78rem; font-weight: 600; color: #047857; }
.pk-comm.is-none { color: var(--muted); font-weight: 500; }
.pk-item > .btn { flex: 0 0 auto; min-width: 84px; }
@media (max-width: 575.98px) {
	.pk-modal .modal-content { border-radius: 0; }
	.pk-actions .btn { font-size: 13px; padding-left: .5rem; padding-right: .5rem; }
	.portal-member .pk-empty { font-size: 12.5px; }
	.portal-member .pk-comm, .portal-member .pk-chosen .pk-meta { font-size: 12px; }
}

/* ==========================================================================
   Member → My Clients / My Referrals – compact rows, approval status, edit / delete
   ========================================================================== */
.cl-tabs { gap: .35rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.cl-tabs::-webkit-scrollbar { display: none; }
.cl-tabs .nav-link { flex: 0 0 auto; padding: .3rem .8rem; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line); }
.cl-tabs .nav-link.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.cl-count { display: inline-block; min-width: 1.35em; margin-left: .2rem; padding: 0 .35em; border-radius: 999px; font-size: .75em; font-weight: 700; text-align: center; background: var(--brand-50); color: var(--brand-ink); }
.cl-tabs .nav-link.active .cl-count { background: rgba(255, 255, 255, .22); color: #fff; }

.cl-card { overflow: hidden; }
.cl-list { list-style: none; margin: 0; padding: 0; }
.cl-row { display: flex; align-items: center; gap: .25rem; padding-right: .6rem; border-bottom: 1px solid var(--line); min-height: 60px; }
.cl-row:last-child { border-bottom: 0; }
.cl-row:hover { background: var(--brand-25); }
.cl-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .75rem; padding: .6rem 0 .6rem .9rem; color: inherit; text-decoration: none; }
.cl-main:hover { color: inherit; }
.cl-main:focus-visible { outline: 2px solid var(--brand-2); outline-offset: -2px; border-radius: 10px; }
.cl-av { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: var(--brand-ink); background: var(--brand-50); }
.cl-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cl-name { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-ref { font-size: .72em; color: #d97706; vertical-align: .1em; }
.cl-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

.cl-status { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.cl-status.is-pending  { background: #fef3c7; color: #92400e; }
.cl-status.is-approved { background: #d1fae5; color: #065f46; }
.cl-status.is-rejected { background: #ffe4e6; color: #9f1239; }

.cl-act { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .15rem; }
.cl-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: .95rem; text-decoration: none; }
.cl-btn:hover, .cl-btn:focus-visible { background: var(--brand-50); color: var(--brand); outline: none; }
.cl-btn.is-danger:hover, .cl-btn.is-danger:focus-visible { background: #ffe4e6; color: #be123c; }
.cl-chev { width: 34px; justify-content: center; color: #b6bccd; }

.cl-approval { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; padding: .7rem .9rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.cl-approval-note { flex: 1 1 220px; min-width: 0; font-size: .82rem; color: var(--muted); }
.cl-approval-act { display: inline-flex; gap: .4rem; }

@media (max-width: 575.98px) {
	.cl-row { min-height: 58px; padding-right: .35rem; }
	.cl-main { gap: .6rem; padding-left: .75rem; }
	.cl-av { flex-basis: 32px; width: 32px; height: 32px; font-size: 13px; }
	.portal-member .cl-name { font-size: 14px; }
	.portal-member .cl-sub { font-size: 12px; }
	.portal-member .cl-status { font-size: 11px; padding: .2rem .5rem; }
	.cl-status .bi { display: none; }
	.cl-btn { width: 36px; height: 36px; }
	.portal-member .cl-tabs .nav-link { font-size: 12.5px; }
	.cl-approval-act { width: 100%; }
	.cl-approval-act .btn, .cl-approval-act form { flex: 1; }
	.cl-approval-act form .btn { width: 100%; }
}

/* ==========================================================================
   Client entry – Google Maps location (Member Portal short form)
   ========================================================================== */
.gm { display: grid; gap: .6rem; }
.gm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.gm-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 700; }
.gm-preview { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--brand-25); aspect-ratio: 16 / 7; min-height: 160px; }
.gm-preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gm-bar { display: flex; align-items: center; gap: .75rem; font-size: .82rem; }
.gm-ok { margin-right: auto; color: #047857; font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; }
.gm-bar a { font-weight: 700; text-decoration: none; }
@media (max-width: 575.98px) {
	.gm-actions .btn { font-size: 13px; padding-left: .4rem; padding-right: .4rem; }
	.gm-preview { aspect-ratio: 4 / 3; }
	.portal-member .gm-bar { font-size: 12.5px; }
}

/* ==========================================================================
   Member Portal – Inter font, weights and spacing (all pages, all screen sizes)
   The size scale is in "Member Portal – typography" above. Here:
     font    Inter (loaded for member pages only; Admin keeps Plus Jakarta Sans)
     weights 400 body · 500 labels / buttons / menu · 600 titles & key figures (700 only for the largest numbers)
     spacing Inter's own tracking: 0 for text, a little tighter for headings / numbers, wider for UPPERCASE labels
   Admin / Super Admin pages are not touched (everything is under html.pt-member / .portal-member).
   ========================================================================== */
html.pt-member { --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
html.pt-member, .portal-member { font-family: var(--font); }
.portal-member { font-feature-settings: "cv11", "ss01"; font-optical-sizing: auto; letter-spacing: 0; line-height: 1.5; }
.portal-member input, .portal-member select, .portal-member textarea, .portal-member button, .portal-member .btn,
.portal-member .form-control, .portal-member .form-select, .portal-member kbd { font-family: inherit; }

/* headings & section titles – semibold, slightly tight */
.portal-member h1, .portal-member h2, .portal-member h3, .portal-member h4, .portal-member h5, .portal-member h6,
.portal-member .h1, .portal-member .h2, .portal-member .h3, .portal-member .h4, .portal-member .h5, .portal-member .h6,
.portal-member .app-bar-title, .portal-member .dg-title, .portal-member .form-section, .portal-member .am-part-head h2,
.portal-member .ch-title, .portal-member .card-header, .portal-member .card-header .fw-semibold, .portal-member .dash-card-title,
.portal-member .pf-head .h5, .portal-member .mpl-name, .portal-member .pc-name, .portal-member .modal-title, .portal-member .pk-modal .modal-title,
.portal-member .empty-state .title { font-weight: 600; letter-spacing: -.011em; line-height: 1.3; }
.portal-member .h5.fw-bold, .portal-member h2.fw-bold { font-weight: 600 !important; }

/* key figures – bold numbers, tabular */
.portal-member .kpi-value, .portal-member .ch-big, .portal-member .stat-value, .portal-member .mpl-price, .portal-member .pc-price,
.portal-member .pl-price, .portal-member .price-card .price, .portal-member .sb-spot-value, .portal-member .po-sum-value { font-weight: 700; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.portal-member .rf-price, .portal-member .pk-price, .portal-member .svc-flat-cell b, .portal-member .cs-item b, .portal-member .ec-val,
.portal-member .level-pill b, .portal-member .kpi-up, .portal-member .kpi-down, .portal-member .ch-tip b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* names in lists / cards */
.portal-member .fw-bold, .portal-member .fw-bolder { font-weight: 600 !important; }
.portal-member b, .portal-member strong { font-weight: 600; }
.portal-member .fw-semibold, .portal-member .cl-name, .portal-member .rf-name, .portal-member .pk-item .pk-name, .portal-member .pk-chosen .pk-name,
.portal-member .m-list .fw-semibold, .portal-member .brand-name, .portal-member .sb-brand .brand-name { font-weight: 600 !important; }

/* labels, buttons, menus, pills – medium */
.portal-member .form-label, .portal-member .kpi-label, .portal-member .pf-dl dt, .portal-member .dl-grid dt, .portal-member .svc-flat-k,
.portal-member .pk-head, .portal-member .cl-status, .portal-member .cl-tabs .nav-link, .portal-member .nav-pills .nav-link,
.portal-member .level-pill, .portal-member .dg-chip, .portal-member .hero-chip, .portal-member .ch-link { font-weight: 500; letter-spacing: 0; }
.portal-member .btn { font-weight: 500; letter-spacing: 0; }
.portal-member .btn-primary, .portal-member .btn-success, .portal-member .btn-danger { font-weight: 600; }
.portal-member .app-sidebar .nl-text, .portal-member .app-sidebar .app-menu .submenu a, .portal-member .bottom-nav a, .portal-member .bottom-nav button { font-weight: 500; letter-spacing: 0; }
.portal-member .app-sidebar .app-menu .submenu a.active { font-weight: 600; }
.portal-member .badge { font-weight: 600; letter-spacing: .01em; }

/* UPPERCASE captions – small, medium weight, tracked */
.portal-member .section-title, .portal-member .app-sidebar .sb-label, .portal-member .table > thead > tr > th, .portal-member .admin-table > thead > tr > th,
.portal-member .pc-table th, .portal-member .content .table > thead > tr > th { font-weight: 600; letter-spacing: .05em; }

/* body copy & helper text */
.portal-member p, .portal-member .form-text, .portal-member .ch-sub, .portal-member .kpi-sub, .portal-member .cl-sub,
.portal-member .text-muted, .portal-member .small, .portal-member small { letter-spacing: 0; }
.portal-member p { margin-bottom: .75rem; }
.portal-member .table { line-height: 1.45; }
.portal-member .table td, .portal-member .table th { vertical-align: middle; }

/* cards / boxes: compact text, aligned */
.portal-member .card-body { line-height: 1.5; }
.portal-member .card-header { padding-top: .75rem; padding-bottom: .75rem; }
.portal-member .am-num { font-weight: 600; }
.portal-member .cl-av { font-weight: 600; }
.portal-member .nav-badge, .portal-member .dot-badge { font-weight: 600; }

/* Member Portal – last typography fixes (all screen sizes) */
body.portal.portal-member { font-size: 14px; }
.portal-member .nb-crumb { font-size: 11.5px; font-weight: 500; }
.portal-member .nb-page, .portal-member .nb-title .nb-page { font-weight: 600; letter-spacing: -.011em; }
.portal-member .cl-count { font-size: 11px; font-weight: 600; }
.portal-member .cl-status { font-size: 11.5px; }
.portal-member .content .table > tfoot > tr > td, .portal-member .content .table > tfoot > tr > th,
.portal-member .pc-table tfoot td, .portal-member .pl-table > tfoot > tr > td { font-weight: 600; }
.portal-member .mpl-no, .portal-member .mpl-label, .portal-member .pc-lv, .portal-member .pc-you, .portal-member .pc-me td,
.portal-member .sb-spot-label, .portal-member kbd, .portal-member .ec-col.is-current .ec-x, .portal-member .table td.num,
.portal-member .avatar-initials { font-weight: 600; }

/* ==========================================================================
   Client entry – plan cards (Member → My Team → Add Member · Select Plan)
   ========================================================================== */
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.pp-card { position: relative; display: flex; flex-direction: column; gap: .35rem; text-align: left; padding: .85rem .95rem; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.pp-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.pp-card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
.pp-card.is-on { border-color: var(--brand); background: var(--brand-25); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.pp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.pp-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; line-height: 1.3; }
.pp-check { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); color: transparent; font-size: 13px; background: #fff; transition: all .15s; }
.pp-card.is-on .pp-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.pp-price { font-size: 18px; font-weight: 700; color: var(--brand); letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.pp-feats { display: grid; gap: .2rem; margin-top: .15rem; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.pp-feats .bi { color: #059669; margin-right: .3rem; }
.pp-more { font-weight: 500; color: var(--brand-ink); }
.pp-grid.is-invalid .pp-card { border-color: #dc3545; }
.pp-grid + .invalid-feedback, .pp-grid ~ .invalid-feedback { display: block; }
@media (max-width: 575.98px) {
	.pp-grid { grid-template-columns: 1fr; gap: .5rem; }
	.pp-card { padding: .75rem .85rem; }
	.pp-feats { grid-template-columns: 1fr 1fr; column-gap: .5rem; }
}

/* Plan cards – after a plan is chosen only that plan is shown, with all its details */
.pp-detail, .pp-feats .pp-extra { display: none; }
.pp-grid.is-picked { grid-template-columns: 1fr; }
.pp-grid.is-picked .pp-card:not(.is-on) { display: none; }
.pp-grid.is-picked .pp-card.is-on { cursor: default; padding: 1rem 1.1rem; }
.pp-grid.is-picked .pp-detail, .pp-grid.is-picked .pp-feats .pp-extra { display: flex; }
.pp-grid.is-picked .pp-more { display: none; }
.pp-grid.is-picked .pp-price { font-size: 20px; }
.pp-grid.is-picked .pp-feats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); column-gap: 1rem; }
.pp-meta { align-items: center; gap: .35rem; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.pp-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.pp-picked-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pp-picked-bar .bi-check-circle-fill { color: var(--brand); }
.pp-picked-bar .btn-link { font-weight: 600; text-decoration: none; font-size: 13px; }
@media (max-width: 575.98px) {
	.pp-grid.is-picked .pp-feats { grid-template-columns: 1fr 1fr; }
}

/* Plan cards (Add Member) – only Plan name · Employees · Software */
.pp-simple .pp-card { gap: .55rem; }
.pp-rows { display: grid; gap: .3rem; }
.pp-row { display: grid; grid-template-columns: 18px 78px minmax(0, 1fr); align-items: center; font-size: 13px; line-height: 1.35; }
.pp-row .bi { color: var(--brand); font-size: 14px; }
.pp-k { color: var(--muted); }
.pp-row b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-row b.is-empty { font-weight: 500; color: var(--muted); font-style: italic; }
.pp-grid.pp-simple.is-picked .pp-card.is-on { padding: .85rem .95rem; }
#c-interest:has(.pp-simple) #c-expected-box { display: none !important; }

/* Plans – "Allowed Employees" (plans.max_employees) on every member plan card */
.plan-limit-line { display: inline-flex; align-items: center; gap: .35rem; align-self: flex-start; margin: .35rem 0 .15rem; padding: .2rem .6rem; border-radius: 999px; background: var(--brand-50); color: var(--ink-2); font-size: 12.5px; font-weight: 500; line-height: 1.4; }
.plan-limit-line .bi { color: var(--brand); }
.plan-limit-line b { font-weight: 600; color: var(--ink); }
.pc-card .plan-limit-line { margin: .15rem 0 .5rem; }
.pp-row { grid-template-columns: 18px 124px minmax(0, 1fr); }
@media (max-width: 575.98px) { .pp-row { grid-template-columns: 18px 118px minmax(0, 1fr); } }
.pp-row { grid-template-columns: 18px 136px minmax(0, 1fr); }
.pp-k { white-space: nowrap; }
@media (max-width: 575.98px) { .pp-row { grid-template-columns: 18px 132px minmax(0, 1fr); } }

/* Member → My Wallet: "All types" + date filters use the bottom-nav label size (11px / weight 500) on phones & tablets.
   !important: portal.css forces 16px !important on every phone input – overridden here for these filters only. */
@media (max-width: 1199.98px) {
	.portal-member .wl-filters .form-select,
	.portal-member .wl-filters input[type="date"], .portal-member .wl-filters input.dp-input { font-size: 11px !important; font-weight: 500; letter-spacing: 0; line-height: 1.5; }
	.portal-member .wl-filters input[type="date"]::-webkit-datetime-edit { font-size: 11px; font-weight: 500; }
	.portal-member .wl-filters .form-select option { font-size: 11px; }
}

/* Date pickers (flatpickr, DD/MM/YYYY) – both portals: calendar icon in the field + portal colours */
input.dp-input:not(.form-control-sm) { padding-right: 2.1rem; }
input.dp-input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 14px 14px; }
input.dp-input.is-invalid { background-image: none; }
.flatpickr-wrapper { display: block; width: 100%; }
.flatpickr-calendar { font-family: inherit; border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(15, 18, 34, .35), 0 0 0 1px rgba(15, 18, 34, .06); }
.flatpickr-day.selected, .flatpickr-day.selected:hover, .flatpickr-day.selected:focus { background: var(--brand); border-color: var(--brand); }
.flatpickr-day.today { border-color: var(--brand); }
.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months { font-weight: 700; }

/* ===== Member → My Earnings Poster ===== */
.ep-tabs { display: flex; gap: .35rem; padding: .3rem; background: var(--brand-25, #f5f7fb); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.ep-tab { flex: 1 0 auto; text-align: center; padding: .5rem .9rem; border-radius: 10px; font-weight: 600; font-size: .875rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.ep-tab:hover { color: var(--ink); }
.ep-tab.active { background: #fff; color: var(--brand); box-shadow: 0 4px 12px -6px rgba(15, 18, 34, .25); }
.ep-prev { font-size: .85rem; margin: -.4rem 0 1rem; color: var(--muted); }
.ep-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.ep-poster { display: block; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 48px -24px rgba(15, 18, 34, .55); background: #111; aspect-ratio: 9 / 16; }
.ep-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ep-empty { aspect-ratio: 9 / 16; border: 2px dashed var(--line); border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .35rem; padding: 1.5rem; background: var(--brand-25, #f8fafc); }
.ep-empty > .bi { font-size: 2.2rem; color: var(--muted); }
.ep-side { display: grid; gap: 1rem; }
.ep-card { padding: 1.1rem 1.2rem; margin: 0; }
.ep-sum-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.ep-k { font-size: .8rem; font-weight: 600; color: var(--muted); }
.ep-total { font-size: 1.9rem; font-weight: 800; color: var(--brand); line-height: 1.15; letter-spacing: -.02em; }
.ep-range { font-size: .8rem; color: var(--muted); }
.ep-verified { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; color: #15803d; background: #dcfce7; border-radius: 999px; padding: .25rem .6rem; white-space: nowrap; }
.ep-rows { margin: .9rem 0 1rem; border-top: 1px solid var(--line); }
.ep-rows > div { display: flex; justify-content: space-between; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.ep-rows span { color: var(--muted); display: inline-flex; gap: .45rem; align-items: center; }
.ep-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: .5rem; }
.ep-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 700; padding-top: .65rem; padding-bottom: .65rem; }
.ep-tip { font-size: .78rem; color: var(--muted); margin: .75rem 0 0; }
.ep-auto-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.ep-auto-head .form-switch .form-check-input { width: 3rem; height: 1.6rem; cursor: pointer; }
.ep-h { font-size: 1rem; font-weight: 700; margin: 0; }
.ep-freq { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .9rem 0; }
.ep-freq .btn { font-weight: 600; }
.ep-consent { margin-bottom: .75rem; }
.ep-status { font-size: .82rem; background: var(--brand-25, #f8fafc); border-radius: 12px; padding: .65rem .8rem; margin-bottom: .85rem; }
@media (max-width: 767.98px) {
	.ep-grid { grid-template-columns: 1fr; }
	.ep-poster-col { max-width: 340px; width: 100%; margin: 0 auto; }
	.ep-tab { padding: .45rem .6rem; font-size: 13px; }
}
.ep-consent .form-check-label { font-size: .82rem; line-height: 1.45; color: var(--muted); }

/* ===== Admin → Payout → Pending Payout (weekly payouts) ===== */
.wp-cycle { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .85rem; color: var(--muted); background: var(--brand-25, #f8fafc); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem; margin-bottom: 1rem; }
.wp-cycle b { color: var(--ink); font-weight: 600; }
.wp-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.wp-bar .mp-tab { text-decoration: none; }
.wp-search { position: relative; flex: 1 1 260px; max-width: 360px; }
.wp-search .bi { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.wp-search .form-control { padding-left: 2.2rem; }
.wp-cards { display: grid; gap: .75rem; padding: .75rem; }
.wp-card { border: 1px solid var(--line); border-radius: 14px; padding: .85rem; background: #fff; display: grid; gap: .6rem; }
.wp-dl { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .75rem; margin: 0; }
.wp-dl dt { font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.wp-dl dd { margin: 0; font-size: .9rem; }
@media (max-width: 767.98px) { .wp-search { max-width: none; } }

/* Member → My Wallet: pending payout line in the balance card */
.wl-payout { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .5rem; padding: .35rem .7rem; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: .82rem; }
.wl-payout .badge { font-size: .7rem; }

/* Member → Edit Profile: photo preview + file input + Remove photo */
.pf-photo { display: flex; align-items: center; gap: .6rem; }
.pf-photo > .avatar { flex: none; border-radius: 50%; object-fit: cover; }
.pf-photo > .form-control { flex: 1 1 auto; min-width: 0; }
.pf-photo-remove { flex: none; white-space: nowrap; }
@media (max-width: 575.98px) { .pf-photo-remove span { display: none; } } /* phones: icon only */
