/* ================================================================
   BMW FRONTEND — Bootstrap 5.2 base + plugin overrides
   All plugin CSS is scoped under .bmw-page or #bmwFlyout
   so it never bleeds into the active WordPress theme.
   ================================================================ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
	--bmw-primary:      #4f46e5;
	--bmw-primary-dark: #3730a3;
	--bmw-accent:       #06b6d4;
	--bmw-success:      #10b981;
	--bmw-warning:      #f59e0b;
	--bmw-danger:       #ef4444;
	--bmw-dark:         #0f172a;
	--bmw-darker:       #080e1c;
	--bmw-surface:      #ffffff;
	--bmw-bg:           #f1f5f9;
	--bmw-border:       #e2e8f0;
	--bmw-muted:        #64748b;
	--bmw-shadow:       0 2px 16px rgba(79,70,229,.10);
	--bmw-shadow-lg:    0 8px 40px rgba(79,70,229,.18);
	--bmw-radius:       .75rem;
	--bmw-radius-sm:    .5rem;
	--bmw-sidebar-w:    300px;
	--bmw-topbar-h:     64px;
	--bmw-transition:   .28s cubic-bezier(.4,0,.2,1);
	--bmw-font:         -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Inter',sans-serif;
}

/* ── Loader ─────────────────────────────────────────────────── */
.front-loader-layer {
	position:        absolute;
	inset:           0;
	background: rgba(152, 157, 242, 0.3);
    backdrop-filter: blur(1px);
	z-index:         9999;
	display:         none;
	align-items:     center;
	justify-content: center;
	/* border-radius:   var(--bmw-radius); */
}
.front-loader-layer.visible { display: flex; }
.front-loader {
	width: 38px; height: 38px;
	border: 3px solid var(--bmw-primary);
	border-top-color: var(--bmw-border);
	border-radius: 50%;
	animation: bmwSpin .7s linear infinite;
	position: absolute;
	left: 50%;
	top: 50%;

}
@keyframes bmwSpin { to { transform: rotate(360deg); } }

/* ================================================================
   TOPBAR — appears at top of every BMW page section
   ================================================================ */
.bmw-topbar {
	display:         flex;
	align-items:     center;
	justify-content: space-between;
	background:      var(--bmw-dark);
	height:          var(--bmw-topbar-h);
	padding:         0 1.25rem;
	position:        sticky;
	top:             0;
	z-index:         1;
	gap:             1rem;
}

/* 3-line hamburger */
.bmw-hamburger {
	display:         flex;
	flex-direction:  column;
	justify-content: center;
	gap:             5px;
	width:           40px;
	height:          40px;
	background:      rgba(255,255,255,.08);
	border:          1px solid rgba(255,255,255,.12);
	border-radius:   .5rem;
	cursor:          pointer;
	padding:         0 9px;
	flex-shrink:     0;
	transition:      background var(--bmw-transition);
}
.bmw-hamburger:hover { background: rgba(255,255,255,.16); }
.bmw-hamburger span {
	display:          block;
	height:           2px;
	background:       #fff;
	border-radius:    2px;
	transition:       transform var(--bmw-transition), opacity var(--bmw-transition), width var(--bmw-transition);
}
/* Animate to X when open */
.bmw-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bmw-hamburger.is-open span:nth-child(2) { opacity: 0; width: 0; }
.bmw-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.bmw-topbar-brand {
	display:     flex;
	align-items: center;
	gap:         .6rem;
	text-decoration: none;
}
.bmw-topbar-brand-icon {
	width:           34px; height: 34px;
	background:      linear-gradient(135deg, var(--bmw-primary), var(--bmw-accent));
	border-radius:   .45rem;
	display:         flex;
	align-items:     center;
	justify-content: center;
	font-size:       .95rem;
	color:           #fff;
	flex-shrink:     0;
}
.bmw-topbar-brand-name {
	font-size:   .95rem;
	font-weight: 700;
	color:       #fff;
	white-space: nowrap;
	overflow:    hidden;
	text-overflow: ellipsis;
	max-width:   180px;
}

.bmw-topbar-right {
	display:     flex;
	align-items: center;
	gap:         .75rem;
	flex-shrink: 0;
}
.bmw-topbar-page {
	font-size:   .8rem;
	color:       rgba(255,255,255,.6);
	font-weight: 500;
	display:     none;
}
@media (min-width: 576px) { .bmw-topbar-page { display: block; } }

.bmw-topbar-avatar {
	width:         36px; height: 36px;
	border-radius: 50%;
	border:        2px solid rgba(255,255,255,.25);
	object-fit:    cover;
	cursor:        pointer;
}

/* Page wrapper */
.bmw-page {
	font-family: var(--bmw-font);
	/* background:  var(--bmw-bg); */
	/* min-height:  70vh; */
}
.bmw-page-content {
	padding: 1.75rem;
}
@media (max-width: 576px) { .bmw-page-content { padding: 1rem; } }

/* ================================================================
   FLYOUT SIDEBAR OVERLAY
   ================================================================ */

/* Backdrop */
#bmwBackdrop {
	position: fixed;
	inset:    0;
	background: rgba(0,0,0,.55);
	z-index:  1040;
	opacity:  0;
	visibility: hidden;
	transition: opacity var(--bmw-transition), visibility var(--bmw-transition);
	backdrop-filter: blur(2px);
}
#bmwBackdrop.is-open { opacity: 1; visibility: visible; }

/* Sidebar panel */
#bmwFlyout {
	position:         fixed;
	top:              0;
	left:             0;
	width:            var(--bmw-sidebar-w);
	max-width:        90vw;
	height:           100%;
	background:       var(--bmw-dark);
	z-index:          1050;
	display:          flex;
	flex-direction:   column;
	overflow:         hidden;
	transform:        translateX(calc(-1 * var(--bmw-sidebar-w)));
	transition:       transform var(--bmw-transition);
	box-shadow:       8px 0 40px rgba(0,0,0,.45);
}
#bmwFlyout.is-open { transform: translateX(0); }

/* Sidebar header */
.bmw-fly-header {
	background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
	padding:    1.5rem 1.25rem 1.25rem;
	border-bottom: 1px solid rgba(255,255,255,.07);
	flex-shrink: 0;
}
.bmw-fly-close {
	display:         flex;
	align-items:     center;
	justify-content: flex-end;
	margin-bottom:   1rem;
}
.bmw-fly-close button {
	background:  rgba(255,255,255,.08);
	border:      1px solid rgba(255,255,255,.12);
	color:       rgba(255,255,255,.7);
	width:       32px; height: 32px;
	border-radius: .4rem;
	display:     flex;
	align-items: center;
	justify-content: center;
	font-size:   .9rem;
	cursor:      pointer;
	transition:  background var(--bmw-transition), color var(--bmw-transition);
}
.bmw-fly-close button:hover { background: rgba(239,68,68,.2); color: #ef4444; border-color: rgba(239,68,68,.3); }

/* User profile block */
.bmw-fly-profile {
	display:     flex;
	align-items: center;
	gap:         .875rem;
}
.bmw-fly-avatar {
	width:         52px; height: 52px;
	border-radius: 50%;
	border:        2px solid rgba(255,255,255,.2);
	object-fit:    cover;
	flex-shrink:   0;
}
.bmw-fly-user-name {
	font-size:   .95rem;
	font-weight: 700;
	color:       #fff;
	line-height: 1.2;
}
.bmw-fly-user-role {
	display:     flex;
	align-items: center;
	gap:         .35rem;
	font-size:   .72rem;
	color:       rgba(255,255,255,.5);
	margin-top:  .2rem;
}
.bmw-fly-status-dot {
	width:         7px; height: 7px;
	background:    var(--bmw-success);
	border-radius: 50%;
	animation:     bmwPulse 2s ease infinite;
	flex-shrink:   0;
}
@keyframes bmwPulse {
	0%,100% { opacity: 1; }
	50%      { opacity: .4; }
}

/* Scrollable nav area */
.bmw-fly-nav {
	flex:      1;
	overflow-y: auto;
	padding:   .625rem 0 1rem;
	scrollbar-width: thin;
	scrollbar-color: rgba(255,255,255,.08) transparent;
}
.bmw-fly-nav::-webkit-scrollbar { width: 3px; }
.bmw-fly-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

/* Group label */
.bmw-fly-group {
	font-size:      .62rem;
	font-weight:    800;
	text-transform: uppercase;
	letter-spacing: .14em;
	color:          rgba(255,255,255,.25);
	padding:        1.125rem 1.25rem .4rem;
}

/* Nav item */
.bmw-fly-item {
	display:         flex;
	align-items:     center;
	gap:             .8rem;
	padding:         .7rem 1.25rem;
	color:           rgba(255,255,255,.58) !important;
	text-decoration: none;
	font-size:       .875rem;
	font-weight:     500;
	position:        relative;
	transition:      background var(--bmw-transition), color var(--bmw-transition);
	border-radius:   0;
}
.bmw-fly-item:hover {
	background:      rgba(255,255,255,.06);
	color:           rgba(255,255,255,.92);
	text-decoration: none;
}
.bmw-fly-item.active {
	background:      rgba(79,70,229,.22);
	color:           #fff;
	font-weight:     600;
}
.bmw-fly-item.active::before {
	content:      '';
	position:     absolute;
	left:         0; top: 0; bottom: 0;
	width:        3px;
	background:   linear-gradient(180deg, var(--bmw-primary), var(--bmw-accent));
	border-radius: 0 2px 2px 0;
}
.bmw-fly-item-icon {
	width:      1.1rem;
	text-align: center;
	font-size:  .88rem;
	flex-shrink: 0;
	opacity:    .75;
}
.bmw-fly-item.active .bmw-fly-item-icon,
.bmw-fly-item:hover  .bmw-fly-item-icon { opacity: 1; }

.bmw-fly-item-arrow {
	margin-left: auto;
	font-size:   .6rem;
	opacity:     .35;
}
.bmw-fly-item.active .bmw-fly-item-arrow { opacity: .7; }

/* Sidebar footer */
.bmw-fly-footer {
	padding:    1rem 1.25rem;
	border-top: 1px solid rgba(255,255,255,.07);
	flex-shrink: 0;
}
.bmw-fly-logout {
	display:         flex;
	align-items:     center;
	gap:             .75rem;
	color:           rgba(255,255,255,.4);
	text-decoration: none;
	font-size:       .85rem;
	padding:         .6rem .5rem;
	border-radius:   var(--bmw-radius-sm);
	transition:      color var(--bmw-transition), background var(--bmw-transition);
}
.bmw-fly-logout:hover { color: #ef4444; background: rgba(239,68,68,.1); text-decoration: none; }
.bmw-fly-logout i { font-size: .9rem; }

/* Divider inside sidebar */
.bmw-fly-divider {
	height:     1px;
	background: rgba(255,255,255,.06);
	margin:     .5rem 1.25rem;
}

/* ================================================================
   REGISTRATION CARD
   ================================================================ */
.bmw-register-hero {
	background: linear-gradient(135deg, var(--bmw-primary) 0%, #6d28d9 55%, var(--bmw-accent) 100%);
	padding:    3rem 2rem;
	text-align: center;
	position:   relative;
	overflow:   hidden;
}
.bmw-register-hero::before {
	content:  '';
	position: absolute;
	inset:    0;
	background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23fff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='30'/%3E%3Ccircle cx='0' cy='0' r='30'/%3E%3Ccircle cx='60' cy='60' r='30'/%3E%3C/g%3E%3C/svg%3E");
}
.bmw-hero-icon {
	width:         72px; height: 72px;
	background:    rgba(255,255,255,.18);
	border:        2px solid rgba(255,255,255,.3);
	border-radius: 50%;
	display:       inline-flex;
	align-items:   center;
	justify-content: center;
	font-size:     1.75rem;
	color:         #fff;
	margin-bottom: 1rem;
	position:      relative;
}
.bmw-register-hero h2 { color: #fff; font-size: 1.75rem; font-weight: 800; margin: 0 0 .5rem; position: relative; }
.bmw-register-hero p  { color: rgba(255,255,255,.82); margin: 0; font-size: .93rem; position: relative; }

/* Form section label */
.bmw-section-label {
	font-size:      .68rem;
	font-weight:    800;
	text-transform: uppercase;
	letter-spacing: .12em;
	color:          var(--bmw-muted);
	padding-bottom: .5rem;
	border-bottom:  1px solid var(--bmw-border);
	margin-bottom:  1rem;
}

/* Icon-prefixed inputs */
.bmw-input-group { position: relative; }
.bmw-input-group .bmw-icon {
	position:       absolute;
	left:           13px; top: 50%;
	transform:      translateY(-50%);
	color:          var(--bmw-muted);
	font-size:      .82rem;
	pointer-events: none;
	z-index:        5;
	transition:     color .2s;
}
.bmw-input-group .form-control {
	padding-left:  2.4rem;
	border-color:  var(--bmw-border);
	border-radius: var(--bmw-radius-sm);
	font-size:     .9rem;
}
.bmw-input-group .form-control:focus {
	border-color: var(--bmw-primary);
	box-shadow:   0 0 0 .2rem rgba(79,70,229,.15);
}

/* Position radio toggle */
.bmw-position-btn input[type="radio"] { display: none; }
.bmw-position-btn label {
	display:         flex;
	align-items:     center;
	justify-content: center;
	gap:             .5rem;
	padding:         .75rem 1rem;
	border:          2px solid var(--bmw-border);
	border-radius:   var(--bmw-radius-sm);
	cursor:          pointer;
	font-weight:     600;
	font-size:       .88rem;
	color:           var(--bmw-muted);
	transition:      all .2s;
	user-select:     none;
}
.bmw-position-btn input:checked + label {
	border-color: var(--bmw-primary);
	background:   rgba(79,70,229,.07);
	color:        var(--bmw-primary);
}
.bmw-position-btn input:disabled + label { opacity: .45; cursor: not-allowed; }

/* Validation messages */
.bmw-msg {
	display:     block;
	font-size:   .77rem;
	min-height:  1rem;
	margin-top:  .25rem;
	font-weight: 500;
}
.bmw-msg:not(:empty) { color: var(--bmw-danger); }
.bmw-msg.is-ok       { color: var(--bmw-success) !important; }

/* Submit button */
.bmw-btn-submit {
	width:       100%;
	padding:     .9rem 1.5rem;
	background:  linear-gradient(135deg, var(--bmw-primary) 0%, #7c3aed 100%);
	border:      none;
	border-radius: var(--bmw-radius-sm);
	color:       #fff;
	font-size:   1rem;
	font-weight: 700;
	cursor:      pointer;
	letter-spacing: .02em;
	transition:  opacity .2s, transform .15s, box-shadow .2s;
}
.bmw-btn-submit:hover {
	opacity: .92;
	transform: translateY(-1px);
	box-shadow: 0 6px 24px rgba(79,70,229,.35);
}
.bmw-btn-submit:active { transform: none; opacity: .88; }

/* ================================================================
   DASHBOARD STAT CARDS
   ================================================================ */
.bmw-stat-card {
	border:        none;
	border-radius: var(--bmw-radius);
	box-shadow:    var(--bmw-shadow);
	overflow:      hidden;
	transition:    transform .2s, box-shadow .2s;
	background:    var(--bmw-surface);
}
.bmw-stat-card:hover { transform: translateY(-3px); box-shadow: var(--bmw-shadow-lg); }
.bmw-stat-card::before { content: ''; display: block; height: 3px; }
.bmw-stat-earnings::before  { background: linear-gradient(90deg,#4f46e5,#818cf8); }
.bmw-stat-available::before { background: linear-gradient(90deg,#10b981,#34d399); }
.bmw-stat-bonus::before     { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
.bmw-stat-downlines::before { background: linear-gradient(90deg,#06b6d4,#67e8f9); }
.bmw-stat-icon {
	width:  48px; height: 48px;
	border-radius: .6rem;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.25rem; flex-shrink: 0;
}
.bmw-stat-label {
	font-size: .7rem; font-weight: 700;
	text-transform: uppercase; letter-spacing: .08em;
	color: var(--bmw-muted); margin: 0 0 .3rem;
}
.bmw-stat-value {
	font-size: 1.65rem; font-weight: 800;
	color: var(--bmw-dark); line-height: 1; margin: 0;
}

/* ================================================================
   CHART & TABLE CARDS
   ================================================================ */
.bmw-card {
	border:        none;
	border-radius: var(--bmw-radius);
	box-shadow:    var(--bmw-shadow);
	background:    var(--bmw-surface);
	overflow:      hidden;
}
.bmw-card-header {
	display:       flex;
	align-items:   center;
	gap:           .6rem;
	padding:       1rem 1.25rem;
	border-bottom: 1px solid var(--bmw-border);
	font-size:     .92rem;
	font-weight:   700;
	color:         var(--bmw-dark);
}
.bmw-card-header i { color: var(--bmw-primary); }

.bmw-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.bmw-table thead th {
	background:     var(--bmw-bg);
	font-size:      .68rem;
	font-weight:    700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color:          var(--bmw-muted);
	padding:        .75rem 1rem;
	border-bottom:  1px solid var(--bmw-border);
	white-space:    nowrap;
}
.bmw-table tbody td {
	padding:        .75rem 1rem;
	border-bottom:  1px solid var(--bmw-border);
	color:          var(--bmw-dark);
	vertical-align: middle;
}
.bmw-table tbody tr:last-child td { border-bottom: none; }
.bmw-table tbody tr:hover td { background: var(--bmw-bg); }

/* Badges */
.bmw-badge {
	display:       inline-flex;
	align-items:   center;
	gap:           .3rem;
	padding:       .25rem .65rem;
	border-radius: 999px;
	font-size:     .7rem;
	font-weight:   700;
}
.bmw-badge-success { background: rgba(16,185,129,.12); color: #059669; }
.bmw-badge-warning { background: rgba(245,158,11,.12); color: #d97706; }
.bmw-badge-danger  { background: rgba(239,68,68,.12);  color: #dc2626; }
.bmw-badge-primary { background: rgba(79,70,229,.12);  color: var(--bmw-primary); }
.bmw-badge-info    { background: rgba(6,182,212,.12);  color: #0891b2; }

/* Empty state */
.bmw-empty-state {
	text-align: center;
	padding:    3rem 1rem;
	color:      var(--bmw-muted);
}
.bmw-empty-state i { font-size: 2.5rem; display: block; margin-bottom: .75rem; opacity: .35; }
.bmw-empty-state p { margin: 0; font-size: .92rem; }

/* Withdrawal balance banner */
.bmw-balance-banner {
	background:    linear-gradient(135deg, var(--bmw-primary), var(--bmw-accent));
	border-radius: var(--bmw-radius);
	padding:       1.5rem 1.75rem;
	color:         #fff;
	display:       flex;
	align-items:   center;
	gap:           1.25rem;
	margin-bottom: 1.5rem;
}
.bmw-balance-banner .bal-icon {
	width:           52px; height: 52px;
	background:      rgba(255,255,255,.2);
	border-radius:   50%;
	display:         flex; align-items: center; justify-content: center;
	font-size:       1.4rem;
	flex-shrink:     0;
}
.bmw-balance-banner .bal-label  { font-size: .72rem; opacity: .82; text-transform: uppercase; letter-spacing: .06em; }
.bmw-balance-banner .bal-amount { font-size: 2rem; font-weight: 800; line-height: 1.1; }

/* Referral link copy box */
.bmw-ref-copy .form-control {
	background: var(--bmw-bg);
	border-color: var(--bmw-border);
	font-size: .85rem;
	color: var(--bmw-muted);
}
.bmw-ref-copy .btn-copy {
	background: var(--bmw-primary);
	border-color: var(--bmw-primary);
	color: #fff;
	font-weight: 600;
	font-size: .85rem;
}
.bmw-ref-copy .btn-copy:hover { background: var(--bmw-primary-dark); }

/* Profile banner */
.bmw-profile-banner {
	background:    linear-gradient(135deg, var(--bmw-primary) 0%, #6d28d9 100%);
	padding:       2rem 1.75rem 2.5rem;
	border-radius: var(--bmw-radius) var(--bmw-radius) 0 0;
}
.bmw-profile-avatar {
	width: 80px; height: 80px;
	border-radius: 50%;
	border: 3px solid rgba(255,255,255,.4);
	object-fit: cover;
}

/* Login notice */
.bmw-login-notice {
	background:    var(--bmw-surface);
	border:        1px solid var(--bmw-border);
	border-radius: var(--bmw-radius);
	padding:       2rem;
	text-align:    center;
	color:         var(--bmw-muted);
	font-size:     .95rem;
}
.bmw-login-notice a { color: var(--bmw-primary); font-weight: 600; }

/* Genealogy */
.bmw-genealogy-wrap { width: 100%; overflow: auto; }
#svgChart {
	width: 100%; min-height: 520px;
	background: #fff;
	border: 1px solid var(--bmw-border);
	border-radius: var(--bmw-radius-sm);
}

/* Pic upload */
.pic-size {
	position: relative; width: 80px; height: 80px;
	border-radius: 50%; overflow: hidden; display: block; cursor: pointer;
}
.pic-image-wrapper {
	position: absolute; inset: 0; border-radius: 50%;
	background: rgba(0,0,0,.45); display: none;
	align-items: center; justify-content: center;
}
.pic-size:hover .pic-image-wrapper { display: flex; }
.pic-edit { color: #fff; font-size: 1.3rem; }
.pic-hidden-input { position: absolute; left: -9999px; }
.pic-layer { display: none; position: absolute; inset: 0; border-radius: 50%; background: rgba(0,0,0,.25); z-index: 99; }
.pic-layer.pic-visible { display: block; }
.pic-loader {
	position: absolute; top: 50%; left: 50%;
	transform: translate(-50%,-50%);
	width: 22px; height: 22px;
	border: 3px solid rgba(255,255,255,.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: bmwSpin .6s linear infinite;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 576px) {
	.bmw-register-hero { padding: 2rem 1rem; }
	.bmw-register-hero h2 { font-size: 1.4rem; }
	.bmw-balance-banner { flex-direction: column; text-align: center; }
	.bmw-page-content { padding: 1rem; }
}

.bmw-panel-rank{
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 999px;
}