/* =====================================================================
   Agent Network portal – shared styles for /admin and /member
   Modern blue theme · app-style shell (fixed top bar with horizontal menu on
   desktop; hamburger drawer + bottom nav on phones) · mobile-first.
   Brand colour comes from Settings → --brand (default #1E5EFF).
   ===================================================================== */
:root {
	--brand: #1E5EFF;
	--brand-ink: #0b2a7a;
	--nav-h: 64px;
	--bottom-h: 64px;
	--surface: #ffffff;
	--page: #f4f7fd;
	--ink: #111c33;
	--muted: #6b7895;
	--line: #e6ebf4;
	--radius: 12px;
	--shadow-sm: 0 1px 2px rgba(17, 28, 51, .04), 0 1px 3px rgba(17, 28, 51, .05);
	--shadow: 0 4px 18px rgba(17, 28, 51, .07);
	--shadow-lg: 0 18px 50px rgba(17, 28, 51, .14);
	--bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--bs-border-radius: .6rem;
	--bs-border-radius-lg: var(--radius);
	--bs-primary: var(--brand);
	--bs-link-color: var(--brand);
	--bs-link-hover-color: color-mix(in srgb, var(--brand) 80%, #000);
}

body.portal, body.login-page {
	background: var(--page);
	color: var(--ink);
	font-family: var(--bs-body-font-family);
	font-size: .9375rem;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); }
.min-w-0 { min-width: 0; }
.fw-600 { font-weight: 600; }

/* ---------- Bootstrap → brand colour ---------- */
.btn { border-radius: 10px; font-weight: 500; padding: .5rem 1rem; }
.btn-sm { border-radius: 8px; padding: .3rem .65rem; }
.btn-lg { border-radius: 12px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: color-mix(in srgb, var(--brand) 86%, #000); --bs-btn-hover-border-color: color-mix(in srgb, var(--brand) 86%, #000); --bs-btn-active-bg: color-mix(in srgb, var(--brand) 76%, #000); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 25%, transparent); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: color-mix(in srgb, var(--brand) 45%, #fff); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-hover-bg: #f2f5fb; }
.btn-light.border { border-color: var(--line) !important; }
.btn-check:checked + .btn-outline-primary { background: var(--brand); border-color: var(--brand); }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.text-bg-primary { background-color: var(--brand) !important; }
.bg-primary-subtle { background-color: color-mix(in srgb, var(--brand) 10%, #fff) !important; }
.border-primary { border-color: color-mix(in srgb, var(--brand) 55%, #fff) !important; }
.page-link { color: var(--brand); border-color: var(--line); }
.pagination { gap: 4px; }
.page-item .page-link { border-radius: 8px !important; }
.active > .page-link, .page-link.active { background-color: var(--brand); border-color: var(--brand); }
.form-control, .form-select { border-radius: 10px; border-color: #dbe2ee; padding: .5rem .8rem; }
.form-control-sm, .form-select-sm { border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: color-mix(in srgb, var(--brand) 55%, #fff); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--brand) 16%, transparent); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-group-text { background: #f6f8fc; border-color: #dbe2ee; }
.badge { font-weight: 600; letter-spacing: .01em; }
.nav-pills .nav-link { border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav-pills .nav-link.active { background: var(--brand); color: #fff; }
.dropdown-menu { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .4rem; font-size: .9rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; display: flex; align-items: center; gap: .55rem; }
.dropdown-item i { color: var(--muted); width: 1.1rem; text-align: center; }
.dropdown-item.active, .dropdown-item:active { background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); font-weight: 600; }
.dropdown-item.active i { color: var(--brand); }
.modal-content { border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); }

/* ---------- App bar (top) ---------- */
.app-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1030; height: calc(var(--nav-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); background: rgba(255,255,255,.94); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(17,28,51,.02); }
.app-bar { height: var(--nav-h); display: flex; align-items: center; gap: .5rem; padding: 0 .5rem; }
@media (min-width: 768px) { .app-bar { padding: 0 1rem; } }
.app-bar-title { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 1.06rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.app-nav .app-brand { margin-right: .75rem; }
.app-brand img { max-height: 36px; max-width: 120px; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #6d28d9)); color: #fff; font-size: 1.2rem; flex: none; box-shadow: 0 6px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
.brand-mark-lg { width: 56px; height: 56px; font-size: 1.7rem; border-radius: 16px; }
.brand-name { font-weight: 700; font-size: 1.02rem; line-height: 1.1; letter-spacing: -.01em; }
.brand-sub { font-size: .7rem; color: var(--muted); font-weight: 500; }

/* ---------- Menu list: slide-in drawer (below 1200px) ---------- */
.app-sidebar { --bs-offcanvas-width: 300px; --bs-offcanvas-transition: transform .25s ease-out; }
.app-sidebar .offcanvas-body { padding: .75rem; }
.app-menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.app-menu .nav-link { color: #3c4a66; font-weight: 500; padding: .62rem .8rem; border-radius: 10px; display: flex; align-items: center; gap: .65rem; min-height: 44px; text-decoration: none; }
.app-menu .nav-link i { font-size: 1.08rem; opacity: .8; width: 1.2rem; text-align: center; }
.app-menu .nav-link:hover { background: #f1f4fb; color: var(--ink); }
.app-menu .nav-link.active { color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, #fff); font-weight: 600; }
.app-menu .nav-link.active i { opacity: 1; }
.app-menu .menu-toggle::after { content: "\F282"; font-family: bootstrap-icons; font-size: .72rem; opacity: .6; transition: transform .2s; }
.app-menu .menu-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.app-menu .submenu { list-style: none; margin: 0; padding: .1rem 0 .35rem 1.55rem; }
.app-menu .submenu a { display: flex; align-items: center; gap: .55rem; min-height: 42px; padding: .45rem .7rem; border-radius: 8px; color: #3c4a66; text-decoration: none; font-size: .9rem; }
.app-menu .submenu a i { color: var(--muted); width: 1.1rem; text-align: center; }
.app-menu .submenu a:hover { background: #f1f4fb; }
.app-menu .submenu a.active { color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, #fff); font-weight: 600; }
.app-menu .submenu a.active i { color: var(--brand); }
.app-menu .submenu .divider { height: 1px; background: var(--line); margin: .3rem .6rem; }

/* ---------- Horizontal top menu (desktop) ---------- */
.top-menu { flex: 1 1 auto; min-width: 0; justify-content: center; }
.top-menu-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.top-link { display: flex; align-items: center; gap: .45rem; padding: .5rem .65rem; border-radius: 10px; color: #3c4a66; font-weight: 500; text-decoration: none; white-space: nowrap; }
.top-link i { font-size: 1.02rem; opacity: .8; }
.top-link:hover, .top-menu .dropdown.show > .top-link { background: #f1f4fb; color: var(--ink); }
.top-link.active { color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, #fff); font-weight: 600; }
.top-link.active i { opacity: 1; }
.top-link.dropdown-toggle::after { border: 0; content: "\F282"; font-family: bootstrap-icons; font-size: .7rem; vertical-align: 0; margin-left: .1rem; opacity: .6; transition: transform .15s; }
.top-link.dropdown-toggle.show::after { transform: rotate(180deg); }
.top-menu .dropdown-menu { min-width: 230px; margin-top: 0 !important; }
/* open sub-menus on hover too (mouse devices); the gap filler keeps the menu open while moving down */
@media (hover: hover) and (min-width: 1200px) {
	.top-menu .dropdown:hover > .dropdown-menu { display: block; top: 100%; left: 0; }
	.top-menu .dropdown > .dropdown-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -.6rem; height: .6rem; }
	.top-menu .dropdown:hover > .top-link { background: #f1f4fb; color: var(--ink); }
	.top-menu .dropdown:hover > .top-link.active { background: color-mix(in srgb, var(--brand) 9%, #fff); color: var(--brand); }
}
/* 1200–1499px: hide the top-level icons so every menu label fits */
@media (min-width: 1200px) and (max-width: 1499.98px) {
	.top-link > i { display: none; }
	.top-link { font-size: .88rem; padding: .5rem .55rem; }
	.app-nav .app-brand .brand-sub { display: none !important; }
}

.nav-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; flex: none; }
.btn-icon { border: 0; background: transparent; width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; font-size: 1.25rem; color: #3c4a66; padding: 0; position: relative; flex: none; text-decoration: none; }
.btn-icon:hover { background: #f1f4fb; color: var(--ink); }
.user-btn { width: auto; height: 44px; padding: 0 .35rem 0 .3rem; gap: .5rem; display: inline-flex; align-items: center; font-size: .88rem; }
.user-btn .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.dot-badge { position: absolute; top: 5px; right: 4px; background: #ef4444; color: #fff; font-size: .6rem; font-weight: 700; min-width: 17px; height: 17px; line-height: 17px; text-align: center; border-radius: 9px; padding: 0 4px; box-shadow: 0 0 0 2px #fff; }

/* Thin loading bar while the next page loads */
.page-loader { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1100; background: var(--brand); box-shadow: 0 0 8px color-mix(in srgb, var(--brand) 60%, transparent); opacity: 0; transition: width 2.5s cubic-bezier(.1,.7,.2,1), opacity .2s; }
body.is-loading .page-loader { width: 85%; opacity: 1; }

/* ---------- Content ---------- */
.content { padding: calc(var(--nav-h) + env(safe-area-inset-top) + 1rem) 1rem calc(var(--bottom-h) + env(safe-area-inset-bottom) + 1.5rem); max-width: 1440px; margin: 0 auto; animation: page-in .22s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (min-width: 768px) { .content { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1200px) { .content { padding: calc(var(--nav-h) + 1.5rem) 2rem 2.5rem; } }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1.2rem; }
.page-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.page-sub { color: var(--muted); font-size: .85rem; margin: .15rem 0 0; }
/* Phones/tablets: the title lives in the app bar */
@media (max-width: 1199.98px) {
	.page-head .page-title { display: none; }
	.page-head-bare { display: none; }
	.page-head { margin-bottom: 1rem; }
}

.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 600; padding: .9rem 1.1rem; }
.card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card-footer { border-top-color: var(--line); padding: .75rem 1.1rem; }
.card-body { padding: 1.1rem; }
.card-hover { transition: box-shadow .15s, transform .15s, border-color .15s; }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.section-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin: 1.6rem 0 .7rem; display: flex; align-items: center; gap: .5rem; }

/* Stat cards */
.stat { display: flex; flex-direction: row; align-items: center; gap: .9rem; padding: 1rem 1.1rem; height: 100%; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.25rem; flex: none; background: color-mix(in srgb, var(--c, var(--brand)) 13%, #fff); color: var(--c, var(--brand)); }
.stat-label { font-size: .76rem; color: var(--muted); line-height: 1.25; font-weight: 500; }
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-value.money { font-size: 1.2rem; }
.stat-foot { font-size: .72rem; color: var(--muted); margin-top: .1rem; }
a.stat:hover .stat-icon { background: var(--c, var(--brand)); color: #fff; }
.level-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.level-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); font-weight: 600; }
.level-pill b { font-size: .95rem; }

/* Period filter (dashboard / branch) */
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.period-bar .btn { border-radius: 999px; padding: .32rem .85rem; font-size: .82rem; }

/* Branch cards */
.branch-card .branch-head { display: flex; align-items: center; gap: .75rem; }
.branch-card .branch-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 11%, #fff); color: var(--brand); font-size: 1.25rem; flex: none; }
.branch-card .mini { text-align: center; padding: .55rem .25rem; border-radius: 10px; background: #f7f9fd; }
.branch-card .mini b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.branch-card .mini span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.branch-card .money-row { display: flex; justify-content: space-between; font-size: .84rem; padding-top: .7rem; border-top: 1px dashed var(--line); margin-top: .8rem; }

/* Top members */
.top-list { list-style: none; padding: 0; margin: 0; }
.top-list li { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--line); }
.top-list li:last-child { border-bottom: 0; }
.rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex: none; background: #eef2f9; color: var(--muted); }
.rank-1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; box-shadow: 0 3px 10px rgba(245,158,11,.35); }
.rank-2 { background: linear-gradient(135deg, #f1f5f9, #94a3b8); color: #1e293b; box-shadow: 0 3px 10px rgba(148,163,184,.35); }
.rank-3 { background: linear-gradient(135deg, #fed7aa, #c2410c); color: #fff; box-shadow: 0 3px 10px rgba(194,65,12,.3); }

/* Charts */
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 240px; }
.chart-box canvas { position: relative; z-index: 1; }

/* Skeleton loading */
.skeleton { position: relative; overflow: hidden; background: #edf1f8; border-radius: 10px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.chart-box .skeleton { position: absolute; inset: 0; z-index: 0; }
.chart-box.ready .skeleton { display: none; }

/* Empty states */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state .bi { font-size: 2.4rem; display: block; margin-bottom: .5rem; color: #b6c1d6; }
.empty-state .title { font-weight: 600; color: var(--ink); margin-bottom: .2rem; }

/* Tables */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .85rem; vertical-align: middle; border-bottom-color: var(--line); }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #f7f9fd; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f8faff; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
.row-flag { color: #dc2626; font-weight: 600; font-size: .75rem; }

/* Mobile list cards (used instead of wide tables on phones) */
.m-list { list-style: none; margin: 0; padding: 0; }
.m-list > li { padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); }
.m-list > li:last-child { border-bottom: 0; }
.m-list a.stretched { color: inherit; text-decoration: none; }

/* Avatars */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; }
.avatar-initials { display: inline-grid; place-items: center; color: #fff; font-weight: 700; }

/* Filters & tabs */
.filter-bar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.filter-bar .form-control, .filter-bar .form-select { font-size: .88rem; }
.status-tabs { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .8rem; scrollbar-width: none; }
.status-tabs::-webkit-scrollbar { display: none; }
.status-tabs a { white-space: nowrap; padding: .42rem .95rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: #3c4a66; text-decoration: none; font-size: .84rem; font-weight: 500; display: inline-flex; align-items: center; gap: .4rem; }
.status-tabs a:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.status-tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 28%, transparent); }
.status-tabs a .count { font-size: .72rem; background: rgba(17,28,51,.07); padding: .05rem .45rem; border-radius: 999px; }
.status-tabs a.active .count { background: rgba(255,255,255,.25); }
.status-tabs a.tab-danger.active { background: #dc2626; border-color: #dc2626; box-shadow: 0 4px 12px rgba(220,38,38,.25); }
.level-tabs { gap: .4rem; padding-bottom: .2rem; }
.level-tabs .nav-link { border: 1px solid var(--line); background: #fff; color: var(--c); font-weight: 600; }
.level-tabs .nav-link .badge { background: color-mix(in srgb, var(--c) 15%, #fff); color: var(--c); }
.level-tabs .nav-link.active { background: var(--c); border-color: var(--c); color: #fff; }
.level-tabs .nav-link.active .badge { background: rgba(255,255,255,.25); color: #fff; }

/* Forms */
.form-section { font-weight: 700; font-size: .95rem; margin: 0 0 .9rem; display: flex; align-items: center; gap: .5rem; color: var(--ink); }
.form-section i { color: var(--brand); width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 10%, #fff); font-size: 1rem; }
.form-label { font-size: .84rem; font-weight: 600; margin-bottom: .35rem; color: #2b3752; }
.form-label .req, .req { color: #dc2626; }
.form-text { font-size: .77rem; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--page) 35%); padding: 1rem 0 .25rem; z-index: 5; }
.pw-toggle { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 5; }
.repeat-row + .repeat-row { margin-top: .5rem; }

/* Plan radio cards (Add Client) & pricing cards */
.plan-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; }
.plan-pick input { position: absolute; opacity: 0; pointer-events: none; }
.plan-pick label { display: block; height: 100%; border: 2px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; position: relative; }
.plan-pick label:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.plan-pick input:checked + label { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.plan-pick input:checked + label::after { content: "\F26B"; font-family: bootstrap-icons; position: absolute; top: .6rem; right: .7rem; color: var(--brand); font-size: 1.1rem; }
.plan-pick input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.plan-pick .plan-name { font-weight: 700; }
.plan-pick .plan-price { font-size: 1.2rem; font-weight: 700; color: var(--brand); }
.plan-pick .plan-limit { font-size: .78rem; color: var(--muted); }
.price-card { border-radius: 16px; position: relative; overflow: hidden; }
.price-card.featured { border: 2px solid var(--brand); box-shadow: 0 14px 40px color-mix(in srgb, var(--brand) 18%, transparent); }
.price-card .price { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.price-card .price small { font-size: .85rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-card .ribbon { position: absolute; top: 14px; right: 14px; }

/* Detail lists */
.dl-grid { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: .5rem .9rem; margin: 0; font-size: .9rem; }
.dl-grid dt { color: var(--muted); font-weight: 500; }
.dl-grid dd { margin: 0; word-break: break-word; }

/* Timeline (status history) */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: .42rem; top: .4rem; bottom: -.2rem; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: .1rem; top: .3rem; width: .9rem; height: .9rem; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.timeline .when { font-size: .76rem; color: var(--muted); }

/* Status stepper on client detail */
.stepper { display: flex; overflow-x: auto; gap: 0; padding: .3rem 0 .6rem; scrollbar-width: thin; }
.stepper .step { flex: 1 0 92px; text-align: center; position: relative; font-size: .72rem; color: var(--muted); }
.stepper .step::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.stepper .step:first-child::before { display: none; }
.stepper .dot { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: grid; place-items: center; margin: 0 auto .3rem; position: relative; z-index: 1; font-size: .8rem; }
.stepper .step.done { color: var(--ink); }
.stepper .step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .step.done::before { background: var(--brand); }
.stepper .step.current .dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
.stepper .step.rejected .dot { background: #dc3545; border-color: #dc3545; color: #fff; }

/* ---------- Tree / org chart ---------- */
.tree-card .card-body { padding: 0; }
.tree-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.tree-toolbar .btn { padding: .25rem .55rem; }
.tree-canvas { position: relative; height: 62vh; min-height: 380px; background: radial-gradient(circle, #d9e1ee 1px, transparent 1px) 0 0 / 22px 22px, #fbfcfe; overflow: hidden; touch-action: none; cursor: grab; border-radius: 0 0 var(--radius) var(--radius); }
.tree-canvas:active { cursor: grabbing; }
.tree-canvas svg { width: 100%; height: 100%; display: block; user-select: none; }
.tree-link { fill: none; stroke: #b7c3d6; stroke-width: 1.6px; }
.tree-node .card-bg { fill: #fff; stroke: #dde4ee; stroke-width: 1px; filter: drop-shadow(0 2px 3px rgba(16,24,40,.08)); }
.tree-node.is-self .card-bg { stroke: var(--brand); stroke-width: 2px; }
.tree-node.is-match .card-bg { stroke: #f59f00; stroke-width: 3px; }
.tree-node .name { font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.tree-node .meta { font-size: 10.5px; fill: var(--muted); }
.tree-node .toggle circle { fill: #fff; stroke: #9fb0c8; stroke-width: 1.4px; }
.tree-node .toggle text { font-size: 12px; font-weight: 700; fill: #4a5a73; }
.tree-node { cursor: pointer; }
.tree-legend { display: flex; flex-wrap: wrap; gap: .7rem; font-size: .76rem; color: var(--muted); }
.tree-legend span::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; background: var(--c); margin-right: .3rem; vertical-align: -1px; }
.tree-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }

/* ---------- Bottom nav (phones / tablets) ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; height: calc(var(--bottom-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch; box-shadow: 0 -4px 14px rgba(16,24,40,.06); }
.bottom-nav a, .bottom-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 500; border: 0; background: none; padding: 0; min-height: 44px; }
.bottom-nav a i, .bottom-nav button i { font-size: 1.3rem; line-height: 1; transition: transform .2s; }
.bottom-nav a.active { color: var(--brand); font-weight: 700; }
.bottom-nav a.active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.bottom-nav a:active i, .bottom-nav button:active i { transform: scale(.9); }

/* Floating action button (main "Add" action on list pages, phones/tablets) */
.fab-float { position: fixed; right: 16px; bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 16px); z-index: 1025; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 1.6rem; text-decoration: none; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 40%, transparent); transition: transform .2s; }
.fab-float:hover { color: #fff; }
.fab-float:active { transform: scale(.94); }
@media (min-width: 1200px) { .fab-float { display: none; } }
@media (max-width: 1199.98px) { .fab-source { display: none !important; } }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; top: calc(var(--nav-h) + .75rem); right: .75rem; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; width: min(380px, calc(100vw - 1.5rem)); }
.login-page .toast-stack { top: .75rem; }
.toast { border: 0; border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; width: 100%; font-size: .88rem; }
.toast .toast-body { display: flex; gap: .65rem; align-items: flex-start; padding: .85rem .9rem; }
.toast .toast-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 1rem; }
.toast-success .toast-icon { background: #dcfce7; color: #15803d; }
.toast-danger .toast-icon { background: #fee2e2; color: #b91c1c; }
.toast-warning .toast-icon { background: #fef3c7; color: #b45309; }
.toast-info .toast-icon { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }
.toast-success { border-left: 4px solid #22c55e !important; }
.toast-danger { border-left: 4px solid #ef4444 !important; }
.toast-warning { border-left: 4px solid #f59e0b !important; }
.toast-info { border-left: 4px solid var(--brand) !important; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .login-page { grid-template-columns: 1.05fr 1fr; } }
.login-hero { display: none; position: relative; overflow: hidden; color: #fff; padding: 3rem; background: radial-gradient(800px 500px at 0% 0%, color-mix(in srgb, var(--brand) 70%, #fff), transparent), linear-gradient(140deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 55%, #0b1437) 100%); }
@media (min-width: 992px) { .login-hero { display: flex; flex-direction: column; justify-content: space-between; } }
.login-hero::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -180px; border-radius: 50%; border: 70px solid rgba(255,255,255,.07); }
.login-hero h2 { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.login-hero .point { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: 1rem; }
.login-hero .point i { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex: none; }
.login-main { display: grid; place-items: center; padding: 1.25rem; background: radial-gradient(700px 400px at 100% 0%, color-mix(in srgb, var(--brand) 9%, #fff), transparent), var(--page); }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 2.1rem 1.6rem; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.login-card .form-floating > .form-control { border-radius: 12px; height: 3.3rem; }

/* ---------- Products & plans ---------- */
.group-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 11%, #fff); color: var(--brand); font-size: 1.2rem; }
.product-card { overflow: hidden; }
.product-img { aspect-ratio: 4 / 3; background: #f1f5f9; display: grid; place-items: center; overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: contain; }
.product-img .bi { font-size: 2.6rem; color: #94a3b8; }
.product-thumb { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 10px; background: #f1f5f9; display: grid; place-items: center; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .bi { font-size: 1.4rem; color: #94a3b8; }
.price-now { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.price-was { color: #94a3b8; text-decoration: line-through; font-size: .85rem; }
.price-off { color: #15803d; font-weight: 600; font-size: .85rem; }
.est-comm { background: #ecfdf5; color: #047857; border: 1px dashed #6ee7b7; border-radius: 10px; padding: .4rem .65rem; font-size: .84rem; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text .ql-align-center { text-align: center; } .rich-text .ql-align-right { text-align: right; }
.gallery-main { aspect-ratio: 4 / 3; background: #f8fafc; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: .4rem; overflow-x: auto; padding-top: .5rem; }
.gallery-thumbs button { border: 2px solid transparent; border-radius: 8px; padding: 0; width: 64px; height: 64px; flex: 0 0 64px; overflow: hidden; background: #f1f5f9; }
.gallery-thumbs button.active { border-color: var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.spec-table th { width: 45%; color: #475569; font-weight: 500; background: #f8fafc; }
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { padding: .28rem 0 .28rem 1.6rem; position: relative; }
.feature-list li::before { content: "\F26E"; font-family: bootstrap-icons; position: absolute; left: 0; color: #16a34a; }
.ql-container { font-size: .95rem; min-height: 160px; }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: #dbe2ee; }
.ql-toolbar.ql-snow { border-radius: 10px 10px 0 0; } .ql-container.ql-snow { border-radius: 0 0 10px 10px; }

/* Tom Select (searchable dropdowns) */
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; border: 0; box-shadow: none; background: none; }
.ts-control { border-radius: 10px !important; border-color: #dbe2ee !important; padding: .5rem .8rem !important; min-height: 40px; }
.ts-dropdown { border-radius: 10px; box-shadow: var(--shadow-lg); border-color: var(--line); }
.ts-dropdown .active { background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--ink); }

/* =====================================================================
   App-like mobile layer (phones & tablets)
   ===================================================================== */
html, body { overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; }

/* Tap targets & form controls (touch screens) */
@media (max-width: 1199.98px) {
	.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
	.btn-sm { padding: .35rem .8rem; }
	.page-link { min-width: 40px; min-height: 40px; display: grid; place-items: center; }
	.form-control, .form-select, .ts-control, .input-group-text { min-height: 44px; font-size: 16px !important; }
	.ts-control input { font-size: 16px !important; }
	textarea.form-control { min-height: 88px; }
	.form-check-input { width: 1.2em; height: 1.2em; }
	.form-label { font-size: .9rem; }
	.dropdown-item { min-height: 44px; }
	.card-footer .btn + .btn, td .btn + .btn, td .btn + form, td form + .btn, td form + form { margin-left: .4rem; }
	.sticky-actions { bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
	/* in-page "← Back to …" links: the app bar already has a back button */
	.content > a.btn:has(> .bi-arrow-left), .page-actions > a.btn:has(> .bi-arrow-left) { display: none; }
	.sticky-actions .btn { flex: 1 1 0; }
	.toast-stack { top: calc(var(--nav-h) + env(safe-area-inset-top) + .5rem); left: 50%; right: auto; transform: translateX(-50%); }
}

/* Phones */
@media (max-width: 575.98px) {
	body.portal { font-size: 15px; }
	.content { padding-left: .75rem; padding-right: .75rem; }
	.card-body { padding: 1rem; }
	/* Full-width primary buttons in forms (not inside input groups / small table actions) */
	.content form .btn-primary:not(.btn-sm):not(.input-group > .btn) { width: 100%; }
	.content form .btn-success:not(.btn-sm):not(.input-group > .btn) { width: 100%; }
	.page-actions > .btn, .page-actions > a.btn, .page-actions > form { flex: 1 1 auto; }
	/* Summary cards: 2 per row, icon above the value */
	.stat { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .85rem; }
	.stat > .min-w-0, .stat > div:last-child { width: 100%; }
	.stat .stat-icon { width: 38px; height: 38px; font-size: 1.05rem; border-radius: 11px; }
	.stat-value { font-size: 1.25rem; }
	.stat-value.money { font-size: 1.05rem; }
	.dl-grid { grid-template-columns: 1fr; gap: .1rem; }
	.dl-grid dt { font-size: .78rem; margin-top: .45rem; }
	.status-tabs a { min-height: 40px; }
}

/* Tables → cards on phones (labels come from the table head, set by portal.js) */
@media screen and (max-width: 767.98px) {
	.table-responsive:has(> .table-cards) { overflow: visible; }
	.table-cards, .table-cards > tbody, .table-cards > tfoot { display: block; width: 100%; }
	.table-cards > thead { display: none; }
	.table-cards > tbody > tr, .table-cards > tfoot > tr { display: flex; flex-direction: column; margin: .6rem; padding: .55rem .85rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
	.table-cards > tfoot > tr { background: #f7f9fd; }
	.table-cards > * > tr > td, .table-cards > * > tr > th { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .4rem 0 !important; border: 0 !important; text-align: right !important; white-space: normal !important; min-width: 0; word-break: break-word; background: transparent !important; }
	.table-cards > * > tr > [data-label]::before { content: attr(data-label); flex: none; max-width: 45%; text-align: left; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
	.table-cards > * > tr > .td-nolabel::before, .table-cards > * > tr > .td-head::before { display: none; }
	.table-cards > * > tr > .td-head { order: -2; justify-content: flex-start; text-align: left !important; font-size: 1rem; padding-bottom: .55rem !important; margin-bottom: .2rem; border-bottom: 1px dashed var(--line) !important; }
	.table-cards > * > tr > .td-key { order: -1; font-weight: 700; }
	.table-cards > * > tr > .td-nolabel { justify-content: flex-end; flex-wrap: wrap; gap: .4rem; }
	.table-cards > * > tr > .td-full { display: block; text-align: center !important; }
	.table-cards > * > tr > .td-nolabel:empty { display: none; }
	.table-cards .btn + .btn, .table-cards .btn + form, .table-cards form + .btn, .table-cards form + form { margin-left: 0 !important; }
}

/* Collapsible filters on phones: search stays, the rest opens with the filter button */
.fb-toggle { display: none; position: relative; flex: none; width: 44px; padding: 0; }
.fb-toggle .badge { position: absolute; top: -6px; right: -6px; font-size: .62rem; }
@media (max-width: 767.98px) {
	.fb-toggle { display: inline-flex; }
	.fb-collapsible .row > [class*="col"]:not(.fb-keep) { display: none !important; }
	.fb-collapsible.fb-open .row > [class*="col"]:not(.d-flex) { display: block !important; animation: page-in .2s ease-out; }
	.fb-collapsible.fb-open .row > [class*="col"].d-flex { display: flex !important; }
	.fb-collapsible .fb-keep { flex: 0 0 100%; max-width: 100%; }
	.fb-collapsible.fb-open .fb-keep { margin-bottom: .25rem; }
}

/* Modals as bottom sheets on phones */
@media (max-width: 575.98px) {
	.modal-dialog, .modal-dialog-centered { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; max-width: none; min-height: 0; display: block; }
	.modal .modal-dialog, .modal.fade .modal-dialog { transform: translateY(100%); transition: transform .25s ease-out; }
	.modal.show .modal-dialog { transform: none; }
	.modal-content { border-radius: 18px 18px 0 0; max-height: 88vh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
	.modal-content::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: #d4dbe7; margin: .6rem auto 0; }
	.modal-footer { flex-wrap: nowrap; }
	.modal-footer .btn { flex: 1 1 0; }
}

/* Submit buttons while the form is sending */
.btn.is-busy { pointer-events: none; opacity: .8; }

/* ---------- Action icon buttons (All Members → Action column / mobile cards) ---------- */
.action-btns { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; vertical-align: middle; }
.action-btns form { display: inline-flex; margin: 0; }
.btn.action-btn {
	--ab-bg: #F3E5F5; --ab-bg-hover: #E8CFEC; --ab-fg: #8E24AA; /* any other action: purple */
	width: 34px; height: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 10px;
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	background: var(--ab-bg); color: var(--ab-fg); font-size: 15px; line-height: 1;
	transition: background-color .2s, transform .2s, box-shadow .2s;
}
.btn.action-btn i { font-size: 15px; }
.btn.action-view   { --ab-bg: #E3F2FD; --ab-bg-hover: #CCE6FB; --ab-fg: #1E88E5; }
.btn.action-edit   { --ab-bg: #FFF3E0; --ab-bg-hover: #FFE3BD; --ab-fg: #FB8C00; }
.btn.action-wallet { --ab-bg: #E8F5E9; --ab-bg-hover: #CFE9D1; --ab-fg: #43A047; }
.btn.action-btn:hover, .btn.action-btn:focus-visible { background: var(--ab-bg-hover); color: var(--ab-fg); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(30, 41, 59, .14); }
.btn.action-btn:active { background: var(--ab-bg-hover); color: var(--ab-fg); transform: scale(.95); box-shadow: none; }
.table td .action-btns { display: flex; justify-content: flex-end; }
/* mobile cards: bigger tap size */
.m-list .btn.action-btn { width: 38px; height: 38px; min-height: 38px; }
@media (prefers-reduced-motion: reduce) { .btn.action-btn { transition: none; } .btn.action-btn:hover { transform: none; } }

/* ---------- Admin tables: common colourful style (.admin-table) ----------
   Cell colours are applied by portal.js (styleAdminTables) from the column header name. */
.card:has(.admin-table) { border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .06); }
.table-responsive:has(> .admin-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
:not(.card) > .table-responsive:has(> .admin-table), :not(.card) > .card-body > .table-responsive:has(> .admin-table) { background: #fff; border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .06); }
.admin-table { border-collapse: separate; border-spacing: 0; border-radius: 12px 12px 0 0; overflow: hidden; background: #fff; }
.admin-table > thead > tr { background: linear-gradient(135deg, #1E88E5, #42A5F5); }
.admin-table > thead > tr > th { background: transparent; color: #fff; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 0; padding: 12px; white-space: normal !important; line-height: 1.25; vertical-align: middle; }
.admin-table > thead > tr > th a { color: #fff !important; }
.admin-table > tbody > tr > td { padding: 12px; font-size: .9rem; border-bottom: 1px solid #EEF2F7; background-color: #fff; box-shadow: none; transition: background-color .2s ease; }
.admin-table > tbody > tr:nth-child(even) > td { background-color: #F5F9FF; }
.admin-table > tbody > tr:hover > td { background-color: #E3F2FD; }
.admin-table > tfoot > tr > td { padding: 12px; }

/* S.No */
.admin-table .mt-sno { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 .35rem; border-radius: 999px; background: #ECEFF1; color: #607D8B; font-size: .75rem; font-weight: 700; }
/* Names: letter avatar + bold */
.admin-table .mt-name, .admin-table .at-name-body { font-weight: 700; color: #1f2937; }
.admin-table .at-name-body .small, .admin-table .at-name-body .text-muted, .admin-table .at-name-body div, .admin-table .at-name-body .badge { font-weight: 400; }
.admin-table .at-name-body .badge { font-weight: 600; }
.admin-table .at-name { display: flex; align-items: center; gap: .55rem; }
.admin-table .mt-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; }
.mt-av-0 { background: #E3F2FD; color: #1E88E5; } .mt-av-1 { background: #FFF3E0; color: #EF6C00; }
.mt-av-2 { background: #E8F5E9; color: #2E7D32; } .mt-av-3 { background: #F3E5F5; color: #8E24AA; }
.mt-av-4 { background: #FCE4EC; color: #D81B60; } .mt-av-5 { background: #E0F2F1; color: #00897B; }
.mt-av-6 { background: #FFF8E1; color: #F9A825; } .mt-av-7 { background: #E8EAF6; color: #3949AB; }
/* Pills */
.admin-table .mt-pill { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1.3; white-space: nowrap; text-decoration: none; }
.admin-table .mt-id { background: #F3E5F5 !important; color: #8E24AA !important; }
.admin-table .mt-branch { background: #E0F2F1 !important; color: #00897B !important; white-space: normal; border-radius: 10px; }
.admin-table .mt-service { background: #E8EAF6 !important; color: #3949AB !important; white-space: normal; border-radius: 10px; }
.admin-table .mt-payroll { background: #FFF3E0 !important; color: #FB8C00 !important; }
.admin-table .mt-level-1 { background: #FFF8E1 !important; color: #F9A825 !important; }
.admin-table .mt-level-2 { background: #E3F2FD !important; color: #1E88E5 !important; }
.admin-table .mt-level-3 { background: #E8F5E9 !important; color: #43A047 !important; }
.admin-table .mt-level-4 { background: #FCE4EC !important; color: #D81B60 !important; }
.admin-table .mt-active { background: #E8F5E9; color: #2E7D32; }
.admin-table .mt-inactive { background: #FFEBEE; color: #C62828; }
.admin-table .mt-utr { background: #F5F5F5 !important; color: #424242 !important; font-family: var(--bs-font-monospace); font-weight: 500; }
.admin-table .mt-mode { font-size: .72rem; letter-spacing: .3px; text-transform: uppercase; }
.mt-mode-upi { background: #EDE7F6; color: #5E35B1; } .mt-mode-neft { background: #E3F2FD; color: #1565C0; }
.mt-mode-imps { background: #E0F7FA; color: #00838F; } .mt-mode-rtgs { background: #FFF3E0; color: #EF6C00; }
.mt-mode-cash { background: #E8F5E9; color: #2E7D32; } .mt-mode-other { background: #ECEFF1; color: #455A64; }
/* Mobile / email */
.admin-table .mt-phone { color: #455A64; white-space: nowrap; }
.admin-table .mt-phone i { color: #78909C; margin-right: .25rem; }
.admin-table .mt-email, .admin-table .mt-email a { color: #1E88E5; }
.admin-table .mt-email i { margin-right: .25rem; }
/* Amounts */
.admin-table .mt-wallet, .admin-table td.mt-amt-pos { font-weight: 700; color: #2E7D32 !important; }
.admin-table td.mt-amt-neg { font-weight: 700; color: #C62828 !important; }
.admin-table .mt-wallet-zero, .admin-table td.mt-amt-zero { font-weight: 700; color: #9E9E9E !important; }

@media (prefers-reduced-motion: reduce) {
	.content, .fb-collapsible.fb-open .row > [class*="col"] { animation: none; }
	.modal-dialog, .app-sidebar { transition: none !important; }
}

/* ---------- Admin dashboard (clean layout) ---------- */
body.portal:has(.dash) { background: #f5f7fb; }
.dash { --d-primary: var(--brand); --d-secondary: var(--brand-2); --d-light: var(--brand-50); --d-line: #e5e9f2; --d-ink: #0f172a; --d-muted: #64748b; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.dash-title { font-size: 1.6rem; font-weight: 700; color: var(--d-ink); margin: 0 0 .2rem; letter-spacing: -.01em; }
.dash-sub { margin: 0; color: var(--d-muted); }
.dash-date { color: var(--d-muted); font-weight: 500; font-size: .9rem; background: #fff; border: 1px solid var(--d-line); border-radius: 999px; padding: .4rem .9rem; white-space: nowrap; }
.dash-date i { color: var(--d-primary); margin-right: .25rem; }
.dash-card { background: #fff; border: 1px solid var(--d-line); border-radius: 14px; padding: 1.35rem 1.4rem; height: 100%; }
.dash-icon { width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--d-light); color: var(--d-primary); font-size: 1.2rem; margin-bottom: .9rem; }
.dash-label { color: var(--d-muted); font-size: .85rem; font-weight: 500; margin-bottom: .25rem; }
.dash-value { color: var(--d-ink); font-size: 1.6rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.dash-note { font-size: .82rem; margin-top: .55rem; opacity: .85; }
.dash-tag { display: inline-block; margin-top: .6rem; padding: .22rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.dash-tag-green { background: #dcfce7; color: #15803d; }
.dash-tag-orange { background: #ffedd5; color: #c2410c; }
.dash-wallet { background: linear-gradient(135deg, var(--d-primary), var(--d-secondary)); border-color: transparent; color: #fff; }
.dash-wallet .dash-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.dash-wallet .dash-label, .dash-wallet .dash-value { color: #fff; }
.dash-wallet .dash-label { opacity: .85; }
.dash-card-title { font-weight: 600; color: var(--d-ink); margin-bottom: 1rem; display: flex; align-items: baseline; gap: .5rem; }
.dash-card-title span { color: var(--d-muted); font-weight: 400; font-size: .85rem; }
.dash-chart { position: relative; height: 320px; }
.dash-empty { color: var(--d-muted); text-align: center; padding: 2.5rem 0; }
.dash-top { list-style: none; margin: 0; padding: 0; }
.dash-top li { display: flex; align-items: center; gap: .75rem; padding: .8rem 0; border-bottom: 1px solid #f1f4f9; }
.dash-top li:last-child { border-bottom: 0; padding-bottom: 0; }
.dash-top li:first-child { padding-top: 0; }
.dash-rank { width: 22px; flex: none; text-align: center; font-weight: 700; color: var(--d-muted); font-size: .85rem; }
.dash-top li:first-child .dash-rank { color: var(--d-primary); }
.dash-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; }
.dash-av-0 { background: var(--brand-50); color: var(--brand); } .dash-av-1 { background: #ecfeff; color: #0e7490; }
.dash-av-2 { background: #f5f3ff; color: #6d28d9; } .dash-av-3 { background: #fdf2f8; color: #be185d; }
.dash-av-4 { background: #fff7ed; color: #c2410c; }
.dash-top-body { min-width: 0; flex: 1 1 auto; }
.dash-top-name { display: block; font-weight: 600; color: var(--d-ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-top-name:hover { color: var(--d-primary); }
.dash-top-meta { color: var(--d-muted); font-size: .8rem; }
.dash-top-amt { font-weight: 700; color: var(--d-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) {
	.dash-card { padding: 1.1rem; }
	.dash-value { font-size: 1.3rem; }
	.dash-icon { width: 36px; height: 36px; font-size: 1.05rem; margin-bottom: .7rem; }
	.dash-chart { height: 260px; }
	.dash-title { font-size: 1.35rem; }
}

/* ---------- Admin → All Members (list + level tree) ---------- */
body.portal:has(.mp) { background: #f5f7fb; }
.mp { --d-primary: var(--brand); --d-secondary: var(--brand-2); --d-light: var(--brand-50); --d-line: #e5e9f2; --d-ink: #0f172a; --d-muted: #64748b; }
.mp-toggle { display: inline-flex; background: #fff; border: 1px solid #e5e9f2; border-radius: 12px; padding: 3px; gap: 2px; }
.mp-toggle button { border: 0; background: transparent; color: #475569; font-weight: 500; font-size: .88rem; padding: .45rem .8rem; border-radius: 9px; white-space: nowrap; min-height: 38px; }
.mp-toggle button.active { background: var(--brand); color: #fff; }
.mp-toggle button:not(.active):hover { background: var(--brand-50); color: var(--brand); }
.mp-panel { background: #fff; border: 1px solid var(--d-line); border-radius: 14px; overflow: hidden; }
.mp-summary { display: flex; align-items: center; gap: 1rem; width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--d-line); border-radius: 14px; padding: 1rem 1.25rem; margin-bottom: 1rem; text-align: left; transition: border-color .15s, box-shadow .15s; }
.mp-summary:hover { border-color: #fdba74; box-shadow: 0 4px 14px rgba(234, 88, 12, .08); }
.mp-summary-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #ffedd5; color: #ea580c; font-size: 1.25rem; flex: none; }
.mp-summary-label { display: block; color: var(--d-muted); font-size: .85rem; font-weight: 500; }
.mp-summary-value { display: block; color: var(--d-ink); font-size: 1.6rem; font-weight: 700; line-height: 1.15; }
.mp-summary-note { margin-left: auto; color: #ea580c; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.mp .filter-bar { border: 1px solid var(--d-line); border-radius: 14px; box-shadow: none; }
.mp-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.mp-tabs::-webkit-scrollbar { display: none; }
.mp-tab { flex: none; display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--d-line); background: #fff; color: #334155; font-weight: 600; font-size: .9rem; padding: .5rem 1rem; border-radius: 12px; min-height: 42px; transition: background-color .15s, color .15s, border-color .15s; }
.mp-tab:hover { border-color: var(--brand-300); color: var(--brand); }
.mp-tab-count { background: var(--brand-50); color: var(--brand); font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; min-width: 26px; text-align: center; }
.mp-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.mp-tab.active .mp-tab-count { background: rgba(255, 255, 255, .2); color: #fff; }
.mp-list-head { padding: .95rem 1rem; font-weight: 700; color: #0f172a; border-bottom: 1px solid #eef2f7; }
.mp-list-head span { color: #64748b; font-weight: 500; }
.mp-node.has-kids { cursor: pointer; }
.mp-node:not(.has-kids) { cursor: default; }
.mp-flabel { display: block; font-size: .75rem; font-weight: 600; color: var(--d-muted); margin-bottom: .25rem; }
#member-list.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.mp-table { margin: 0; }
.mp-table > thead > tr > th { background: #f8fafc; color: var(--d-muted, #64748b); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .8rem 1rem; border-bottom: 1px solid #e5e9f2; white-space: nowrap; }
.mp-table > tbody > tr > td { padding: .8rem 1rem; border-bottom: 1px solid #eef2f7; vertical-align: middle; font-size: .9rem; color: #0f172a; }
.mp-table > tbody > tr:last-child > td { border-bottom: 0; }
.mp-table > tbody > tr:hover > td { background: var(--brand-25); }
.mp-sno { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: .75rem; font-weight: 700; }
.mp-member, .mp-detail { display: flex; align-items: center; gap: .7rem; }
.mp-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .78rem; }
.mp-av-0 { background: var(--brand-50); color: var(--brand); } .mp-av-1 { background: #ecfeff; color: #0e7490; }
.mp-av-2 { background: #f5f3ff; color: #6d28d9; } .mp-av-3 { background: #fdf2f8; color: #be185d; }
.mp-av-4 { background: #fff7ed; color: #c2410c; }
.mp-name { font-weight: 600; color: #0f172a; text-decoration: none; }
a.mp-name:hover { color: var(--brand); }
.mp-code { color: #64748b; font-size: .78rem; }
.mp-level { display: inline-block; min-width: 30px; text-align: center; padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.mp-lv-1 { background: var(--brand-ink); color: #fff; } .mp-lv-2 { background: var(--brand); color: #fff; }
.mp-lv-3 { background: var(--brand-100); color: var(--brand); } .mp-lv-4 { background: #e5e7eb; color: #475569; }
.mp-pending { display: inline-block; border: 0; background: #ffedd5; color: #ea580c; font-size: .75rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; white-space: nowrap; cursor: pointer; }
button.mp-pending:hover { background: #fed7aa; }
.mp-pending-static { cursor: default; }
.mp-pending-zero { display: inline-block; background: #f1f5f9; color: #94a3b8; font-size: .75rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; }
.mp-pending .bi { font-size: .65rem; margin-left: .15rem; display: inline-block; transition: transform .15s; }
.mp-pending[aria-expanded="true"] .bi { transform: rotate(180deg); }
/* Pending requests summary works as a "Pending only" toggle */
.mp-summary .mp-on-text { display: none; }
.mp-summary.is-on { border-color: #ea580c; background: #fff7ed; }
.mp-summary.is-on .mp-on-text { display: inline; }
.mp-summary.is-on .mp-off-text { display: none; }
/* Pending requests listed under a member (Approve / Reject) */
.mp-req-row > td { background: #fffaf5 !important; padding: 0 !important; }
.mp-reqs { padding: .75rem 1rem .85rem 3.25rem; border-left: 3px solid #fb923c; }
.mp-cards .mp-reqs { padding: .65rem .75rem; margin-top: .65rem; border-radius: 10px; background: #fffaf5; }
.mp-reqs-title { font-size: .78rem; font-weight: 700; color: #c2410c; text-transform: uppercase; letter-spacing: .03em; margin-bottom: .4rem; }
.mp-req { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(140px, 2fr) 110px 100px auto; align-items: center; gap: .5rem 1rem; padding: .55rem 0; border-top: 1px dashed #fed7aa; }
.mp-req:first-of-type { border-top: 0; }
.mp-req.is-done { opacity: .45; pointer-events: none; }
.mp-req-info { display: flex; flex-direction: column; min-width: 0; }
.mp-req-type { font-size: .85rem; color: #334155; }
.mp-req-amt { font-weight: 700; text-align: right; white-space: nowrap; }
.mp-req-date { font-size: .82rem; color: #64748b; white-space: nowrap; }
.mp-req-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.mp-req-actions form { margin: 0; }
.mp-reject { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.mp-reject.d-none { display: none !important; }
.mp-reject select { max-width: 240px; }
.mp-reject input { max-width: 320px; flex: 1 1 180px; }
@media (max-width: 991.98px) {
	.mp-reqs { padding-left: 1rem; }
	.mp-req { grid-template-columns: 1fr auto; }
	.mp-req-type, .mp-req-date { grid-column: 1; }
	.mp-req-amt { grid-column: 2; grid-row: 1; }
	.mp-req-actions { grid-column: 1 / -1; justify-content: stretch; }
	.mp-req-actions > * { flex: 1; }
	.mp-req-actions .btn { width: 100%; }
	.mp-reject select, .mp-reject input { max-width: none; flex: 1 1 100%; }
}
/* Menu badge on top-level links (Members) */
.top-link .nav-badge { margin-left: .35rem; }
.app-menu .nav-link .nav-badge { margin-left: auto; }
.mp-status { display: inline-block; font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; }
.mp-status-on { background: #dcfce7; color: #15803d; } .mp-status-off { background: #fee2e2; color: #b91c1c; }
.mp-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .85rem 1rem; border-top: 1px solid #eef2f7; }
.mp-count { color: #64748b; font-size: .85rem; }
.mp-per { width: auto; min-width: 76px; min-height: 34px !important; font-size: .85rem !important; }
.mp-foot .pagination { margin: 0; }
.mp-empty { text-align: center; color: #64748b; padding: 2.5rem 1rem; }
.mp-empty i { display: block; font-size: 1.8rem; color: #cbd5e1; margin-bottom: .4rem; }
/* phones: stacked member cards */
.mp-cards { padding: .75rem; display: grid; gap: .75rem; }
.mp-card { border: 1px solid #e5e9f2; border-radius: 14px; padding: .9rem; }
.mp-card-head { display: flex; align-items: center; gap: .7rem; padding-bottom: .7rem; border-bottom: 1px solid #f1f4f9; }
.mp-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .9rem; margin: .7rem 0; }
.mp-card-grid dt { font-size: .7rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .03em; }
.mp-card-grid dd { margin: 0; font-size: .88rem; color: #0f172a; }
.mp-card-actions { display: flex; justify-content: flex-end; padding-top: .7rem; border-top: 1px solid #f1f4f9; }
.mp-card .btn.action-btn { width: 38px; height: 38px; min-height: 38px; }
/* popup */
.mp-modal { border-radius: 14px; border: 1px solid #e5e9f2; }
.mp-detail { flex-wrap: wrap; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1rem; }
.mp-detail-stats { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.mp-detail-stats span { display: block; font-size: .72rem; color: #64748b; }
.mp-detail-stats b { font-size: .95rem; color: #0f172a; }
/* level tree */
.mp-tree-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid #eef2f7; }
.mp-zoom { display: inline-flex; align-items: center; gap: .35rem; }
.mp-zoom span { min-width: 42px; text-align: center; font-size: .82rem; color: #64748b; font-variant-numeric: tabular-nums; }
.mp-tree-scroll { overflow: auto; padding: 1.5rem 1rem 2rem; min-height: 320px; max-height: 75vh; background: radial-gradient(circle, #e2e8f0 1px, transparent 1px) 0 0 / 22px 22px, #fbfcfe; }
.mp-tree-canvas { width: max-content; min-width: 100%; }
.mp-tree, .mp-tree ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.mp-tree ul { padding-top: 22px; position: relative; }
.mp-tree li { position: relative; padding: 22px 8px 0; display: flex; flex-direction: column; align-items: center; }
.mp-tree > li { padding-top: 0; }
/* connectors: horizontal bar across siblings + vertical drop into each child */
.mp-tree li::before, .mp-tree li::after { content: ""; position: absolute; top: 0; width: 50%; height: 22px; border-top: 2px solid #cbd5e1; }
.mp-tree li::before { right: 50%; }
.mp-tree li::after { left: 50%; border-left: 2px solid #cbd5e1; }
.mp-tree li:only-child::before { display: none; }
.mp-tree li:only-child::after { border-top: 0; }
.mp-tree li:first-child::before, .mp-tree li:last-child::after { border-top: 0; }
.mp-tree li:last-child::before { border-right: 2px solid #cbd5e1; border-top-right-radius: 8px; }
.mp-tree li:first-child::after { border-top-left-radius: 8px; }
.mp-tree > li::before, .mp-tree > li::after { display: none; }
.mp-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid #cbd5e1; }
.mp-tree li.collapsed > ul { display: none; }
.mp-node { position: relative; display: flex; align-items: center; gap: .6rem; width: 210px; background: #fff; border: 1px solid #e5e9f2; border-radius: 14px; padding: .65rem .75rem; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.mp-node:hover, .mp-node:focus-visible { border-color: var(--brand-300); box-shadow: 0 4px 14px var(--brand-ring); outline: none; }
.mp-node.is-off { opacity: .6; }
.mp-node-body { min-width: 0; flex: 1 1 auto; }
.mp-node-name { font-weight: 600; font-size: .86rem; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-node-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; font-size: .72rem; color: #64748b; }
.mp-node-meta .mp-pending { font-size: .68rem; padding: .1rem .45rem; }
.mp-node-toggle { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 2px; border: 1px solid #cbd5e1; background: #fff; color: var(--brand); border-radius: 999px; font-size: .68rem; font-weight: 700; padding: 1px 7px; z-index: 1; line-height: 1.4; }
.mp-node-toggle i { transition: transform .15s; font-size: .65rem; }
li.collapsed > .mp-node .mp-node-toggle i { transform: rotate(-90deg); }
.mp-node-toggle:hover { background: var(--brand-50); }
@media (max-width: 767.98px) {
	.mp-summary { max-width: none; }
	.mp-summary-note { display: none; }
	.mp-toggle { width: 100%; }
	.mp-toggle button { flex: 1 1 0; }
	.mp-foot { justify-content: center; }
}

/* ---------- Admin → Settings (General Settings) ---------- */
body.portal:has(.gs) { background: #f5f7fb; }
.gs { max-width: 900px; }
.gs-card { background: #fff; border: 1px solid #e5e9f2; border-radius: 14px; padding: 1.25rem 1.35rem; margin-bottom: 1rem; }
.gs-title { display: flex; align-items: center; gap: .55rem; font-size: 1rem; font-weight: 700; color: #0f172a; margin: 0 0 1rem; }
.gs-title i { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: 1rem; }
.gs .form-label { font-weight: 600; font-size: .85rem; color: #334155; margin-bottom: .35rem; }
.gs-logo { max-height: 48px; border: 1px solid #e5e9f2; border-radius: 10px; padding: .25rem; background: #fff; }
.gs-actions { display: flex; justify-content: flex-end; margin: .5rem 0 1rem; }
.gs-sub { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin: 1.4rem 0 .75rem; padding-top: 1.1rem; border-top: 1px solid #eef2f7; }
.gs-title + .gs-sub { margin-top: 0; padding-top: 0; border-top: 0; }
.gs-card-actions { display: flex; justify-content: flex-end; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #eef2f7; }
@media (max-width: 575.98px) { .gs-card-actions .btn { width: 100%; } }
.wallet-min-note { display: inline-block; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: .2rem .65rem; }
.gs-note { margin-top: 1rem; padding: .65rem .9rem; border-radius: 10px; background: var(--brand-50); color: var(--brand-ink); font-size: .88rem; }
.gs-note i { color: var(--brand); margin-right: .25rem; }
@media (max-width: 575.98px) { .gs-card { padding: 1rem; } .gs-actions .btn { width: 100%; } }

/* ---------- Admin → Payment ▾ Payout ---------- */
/* menu badge: pending payouts */
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 .4rem; margin-left: .4rem; border-radius: 999px; background: #ffedd5; color: #ea580c; font-size: .7rem; font-weight: 800; line-height: 1; cursor: pointer; vertical-align: middle; }
.nav-badge:hover, .nav-badge:focus-visible { background: #ea580c; color: #fff; outline: none; }
.dropdown-item .nav-badge { margin-left: auto; }
.dropdown-item:has(.nav-badge) { display: flex; align-items: center; gap: .5rem; }
.po-pending-card { display: flex; align-items: center; gap: 1rem; width: 100%; text-align: left; background: #fff; border: 1px solid #fed7aa; border-left: 5px solid #ea580c; border-radius: 14px; padding: 1.1rem 1.35rem; margin-bottom: 1rem; transition: box-shadow .15s, background-color .15s; }
.po-pending-card:hover { background: #fffaf5; box-shadow: 0 4px 14px rgba(234, 88, 12, .1); }
.po-pending-icon { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; background: #ffedd5; color: #ea580c; font-size: 1.5rem; }
.po-pending-title { display: block; color: #9a3412; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.po-pending-count { display: block; color: #ea580c; font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.po-pending-count b { font-size: 2rem; font-weight: 800; margin-right: .2rem; }
.po-pending-amt { display: block; color: #64748b; font-size: .9rem; }
.po-pending-amt span { color: #0f172a; font-weight: 700; }
.po-pending-go { margin-left: auto; color: #ea580c; font-weight: 600; font-size: .85rem; white-space: nowrap; }
@media (max-width: 575.98px) { .po-pending-go { display: none; } .po-pending-count b { font-size: 1.6rem; } }
.po-sum { display: flex; align-items: center; gap: .9rem; background: #fff; border: 1px solid #e5e9f2; border-radius: 14px; padding: 1.1rem 1.25rem; height: 100%; }
.po-sum-icon { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; }
.po-ic-total { background: var(--brand-50); color: var(--brand); } .po-ic-pending { background: #ffedd5; color: #ea580c; } .po-ic-paid { background: #dcfce7; color: #16a34a; }
.po-sum-label { color: #64748b; font-size: .85rem; font-weight: 500; }
.po-sum-value { color: #0f172a; font-size: 1.45rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.po-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; background: #fff; border: 1px solid #e5e9f2; border-radius: 14px; padding: .75rem; }
.po-search { position: relative; flex: 1 1 280px; }
.po-search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.po-search .form-control { padding-left: 2.3rem; }
.po-filters .mp-tabs { padding-bottom: 0; }
.po-status { display: inline-block; font-size: .75rem; font-weight: 700; padding: .22rem .65rem; border-radius: 999px; }
.po-paid { background: #dcfce7; color: #16a34a; } .po-pending { background: #ffedd5; color: #ea580c; } .po-below { background: #f1f5f9; color: #64748b; }
#po-list.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.mp-card-grid .grid-span-2 { grid-column: span 2; }
.po-view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: .8rem; margin-bottom: .8rem; border-bottom: 1px solid #eef2f7; }
.po-view { margin: 0; display: grid; gap: .5rem; }
.po-view > div { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.po-view dt { color: #64748b; font-weight: 500; }
.po-view dd { margin: 0; text-align: right; color: #0f172a; }
@media (max-width: 767.98px) { .po-reset { flex: 1 1 auto; } .po-sum-value { font-size: 1.15rem; } .po-sum { padding: .9rem; gap: .65rem; } .po-sum-icon { width: 38px; height: 38px; } }

/* ---------- Plan cards with their own commission table (member Add Client + admin Payroll Plans) ---------- */
.pc-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) { .pc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .pc-grid { grid-template-columns: repeat(3, 1fr); } }
.pc-col { position: relative; display: flex; }
.pc-radio { position: absolute; opacity: 0; pointer-events: none; }
.pc-card { position: relative; display: flex; flex-direction: column; gap: .85rem; width: 100%; margin: 0; background: #fff; border: 2px solid #e5e9f2; border-radius: 14px; padding: 1.1rem; cursor: pointer; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.pc-card.pc-static { cursor: default; }
.pc-card.is-off { opacity: .7; }
label.pc-card:hover { border-color: var(--brand-300); }
.pc-radio:checked + .pc-card { border-color: var(--brand); background: var(--brand-25); box-shadow: 0 0 0 4px var(--brand-ring); }
.pc-radio:focus-visible + .pc-card { outline: 2px solid var(--brand); outline-offset: 2px; }
.pc-selected { display: none; position: absolute; top: -.7rem; right: 1rem; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; box-shadow: 0 2px 6px var(--brand-ring); }
.pc-radio:checked + .pc-card .pc-selected { display: inline-block; }
.pc-head { display: flex; flex-direction: column; gap: .2rem; }
.pc-name { font-weight: 700; font-size: 1.05rem; color: #0f172a; }
.pc-price { font-size: 1.55rem; font-weight: 800; color: var(--brand); line-height: 1.2; }
.pc-limit { color: #64748b; font-size: .85rem; }
.pc-desc { color: #475569; font-size: .85rem; margin-top: .2rem; }
.pc-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; border: 1px solid #e5e9f2; border-radius: 10px; overflow: hidden; }
.pc-table th { background: #f8fafc; color: #64748b; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .5rem .65rem; border-bottom: 1px solid #e5e9f2; }
.pc-table td { padding: .45rem .65rem; border-bottom: 1px solid #f1f4f9; color: #0f172a; font-variant-numeric: tabular-nums; }
.pc-table tfoot td { background: #f8fafc; font-weight: 800; border-bottom: 0; border-top: 1px solid #e5e9f2; }
.pc-table tr.pc-none td { color: #94a3b8; }
.pc-table tr.pc-me td { background: #fff7ed; font-weight: 700; }
.pc-table tr.pc-me td:first-child { box-shadow: inset 3px 0 0 #ea580c; }
.pc-lv { display: inline-block; font-size: .7rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; }
.pc-lv-co { background: #f1f5f9; color: #334155; }
.pc-lv-1 { background: var(--brand-ink); color: #fff; } .pc-lv-2 { background: var(--brand); color: #fff; }
.pc-lv-3 { background: var(--brand-100); color: var(--brand); } .pc-lv-4 { background: #e5e7eb; color: #475569; }
.pc-you { display: inline-block; font-size: .66rem; font-weight: 700; color: #ea580c; background: #ffedd5; padding: .1rem .45rem; border-radius: 999px; margin-left: .2rem; }
.pc-select { margin-top: auto; display: block; text-align: center; padding: .6rem; border-radius: 10px; border: 1px solid var(--brand-200); color: var(--brand); font-weight: 600; font-size: .9rem; background: var(--brand-50); }
.pc-select-on { display: none; }
.pc-radio:checked + .pc-card .pc-select { background: var(--brand); border-color: var(--brand); color: #fff; }
.pc-radio:checked + .pc-card .pc-select-on { display: inline; }
.pc-radio:checked + .pc-card .pc-select-off { display: none; }
.pc-actions { margin-top: auto; display: flex; gap: .5rem; align-items: stretch; }
.pc-actions form { margin: 0; }
.pc-note { background: var(--brand-50); color: var(--brand-ink); border-radius: 10px; padding: .65rem .9rem; font-size: .88rem; margin-bottom: 1rem; }
.pc-note i { color: var(--brand); margin-right: .25rem; }

/* ---------- Admin → Plan (plan cards + commission table) ---------- */
body.portal:has(.pl) { background: #f5f7fb; }
.pl { }
.pl-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; width: 100%; height: 100%; text-align: left; background: #fff; border: 1px solid #e5e9f2; border-radius: 14px; padding: 1.25rem 1.35rem; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.pl-card:hover { border-color: var(--brand-300); }
.pl-card.is-selected { border: 2px solid var(--brand); background: var(--brand-50); padding: calc(1.25rem - 1px) calc(1.35rem - 1px); box-shadow: 0 4px 14px var(--brand-ring); }
.pl-card.is-off { opacity: .7; }
.pl-check { position: absolute; top: 1rem; right: 1rem; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #cbd5e1; color: transparent; font-size: .9rem; transition: all .15s; }
.pl-card.is-selected .pl-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.pl-name { font-weight: 700; color: #0f172a; font-size: 1.05rem; padding-right: 2rem; }
.pl-off { font-size: .7rem; font-weight: 600; background: #f1f5f9; color: #64748b; padding: .1rem .45rem; border-radius: 999px; vertical-align: middle; }
.pl-price { font-size: 1.7rem; font-weight: 800; color: var(--brand); letter-spacing: -.01em; line-height: 1.2; }
.pl-limit { color: #64748b; font-size: .88rem; }
.pl-box { background: #fff; border: 1px solid #e5e9f2; border-radius: 14px; overflow: hidden; }
.pl-box-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1rem 1.25rem; border-bottom: 1px solid #eef2f7; }
.pl-title { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin: 0; }
.pl-warn { margin: 1rem 1.25rem 0; padding: .65rem .9rem; border-radius: 10px; background: #fff7ed; color: #c2410c; font-size: .88rem; font-weight: 500; }
.pl-table > thead > tr > th { background: #f8fafc; color: #64748b; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .8rem 1.25rem; border-bottom: 1px solid #e5e9f2; }
.pl-table > tbody > tr > td, .pl-table > tfoot > tr > td { padding: .85rem 1.25rem; border-bottom: 1px solid #eef2f7; vertical-align: middle; font-variant-numeric: tabular-nums; }
.pl-table > tfoot > tr > td { font-weight: 800; color: #0f172a; background: #f8fafc; border-bottom: 0; }
.pl-role { display: inline-block; font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; }
.pl-r1 { background: var(--brand-ink); color: #fff; } .pl-r2 { background: var(--brand); color: #fff; }
.pl-r3 { background: var(--brand-100); color: var(--brand); } .pl-r4 { background: #e5e7eb; color: #475569; }
.pl-hint { color: #94a3b8; font-size: .8rem; margin-left: .35rem; }
.pl-note { padding: .8rem 1.25rem; color: #64748b; font-size: .8rem; border-top: 1px solid #eef2f7; }
.pl-empty { text-align: center; color: #64748b; padding: 2.5rem 1rem; }
.pl-empty i { display: block; font-size: 1.8rem; color: #cbd5e1; margin-bottom: .4rem; }
.pl-role { white-space: nowrap; }
/* Other Services */
.pl-svc-summary { margin: 1rem 1.25rem; padding: .7rem .95rem; border-radius: 10px; background: #f8fafc; border: 1px dashed #cbd5e1; color: #64748b; font-size: .9rem; }
.pl-svc-summary.is-on { background: var(--brand-50); border: 1px solid var(--brand-200); color: var(--brand-ink); }
.pl-svc-summary.is-on i { color: var(--brand); }
.pl-svc-table > thead > tr > th { white-space: nowrap; }
.pl-svc-table .pl-role { font-size: .68rem; text-transform: none; letter-spacing: 0; }
.pl-svc-row { cursor: pointer; }
.pl-svc-row > td { transition: background-color .15s; }
.pl-svc-row:hover > td { background: var(--brand-25); }
.pl-svc-row.is-selected > td { background: var(--brand-50); }
.pl-svc-row.is-off { opacity: .65; }
.pl-svc-name { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: #0f172a; cursor: pointer; margin: 0; }
.pl-svc-name .form-check-input { margin: 0; flex: none; }
.pl-svc-pct { color: #64748b; }
.pl-sno { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: .75rem; font-weight: 700; }
.pl-svc-cards { display: grid; gap: .75rem; padding: 0 .9rem .9rem; }
.pl-svc-card { border: 1px solid #e5e9f2; border-radius: 14px; padding: .9rem; transition: background-color .15s, border-color .15s; }
.pl-svc-card.is-selected { background: var(--brand-50); border-color: var(--brand); }
.pl-svc-card dl { margin: .7rem 0; display: grid; gap: .45rem; }
.pl-svc-card dl > div { display: flex; justify-content: space-between; align-items: center; gap: .75rem; font-size: .88rem; }
.pl-svc-card dt { font-weight: 500; color: #64748b; }
.pl-svc-card dd { margin: 0; text-align: right; }
.pl-svc-card .pl-svc-total { border-top: 1px solid #e5e9f2; padding-top: .45rem; font-weight: 700; }
.pl-svc-card .pl-svc-total dt, .pl-svc-card .pl-svc-total dd { color: #0f172a; font-weight: 700; }
@media (max-width: 575.98px) {
	.pl-hint { display: none; }
	.pl-price { font-size: 1.45rem; }
	.pl-table > thead > tr > th { white-space: normal; padding: .7rem .75rem; font-size: .68rem; }
	.pl-table > tbody > tr > td, .pl-table > tfoot > tr > td { padding: .75rem; }
	.pl-box-head { padding: .9rem .9rem; }
}

/* ---------- Print: only the report content (Reports → Print) ---------- */
.print-only { display: none; }
@media print {
	.admin-table > thead > tr { background: none; }
	.admin-table > thead > tr > th { color: #000; border-bottom: 1px solid #999; }
	.admin-table > thead > tr > th a { color: #000 !important; }
	.app-nav, .app-sidebar, .bottom-nav, .fab-float, .page-loader, .filter-bar, .no-print, .alert, .toast-stack, .page-head .btn { display: none !important; }
	.content { padding: 0 !important; margin: 0 !important; max-width: none; animation: none; }
	.print-only { display: block !important; }
	.card { border: 0 !important; box-shadow: none !important; }
	.table-responsive { overflow: visible !important; }
	.table { font-size: 10px; }
	.table thead th { background: #eef2f7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	@page { size: A4 landscape; margin: 10mm; }
}
