/* ╔══════════════════════════════════════════════════════════════════╗
   ║  MSpace Business Portal – Ultra-Premium Design System          ║
   ║  Glassmorphism · Apple-grade · MSpace Brand                    ║
   ╚══════════════════════════════════════════════════════════════════╝ */

/* ─────────────────────────── Design Tokens ─────────────────────────── */
:root {
    /* MSpace Brand */
    --ms-navy:   #00008B;
    --ms-blue:   #1a1aff;
    --ms-indigo: #3b5bdb;
    --ms-mid:    #4361ee;
    --ms-red:    #b70000;
    --ms-red-lt: #ef4444;

    /* Dark bg / surface */
    --bp-bg:               #070b18;
    --bp-bg2:              #0c1228;
    --bp-surface:          rgba(255,255,255,0.042);
    --bp-surface-solid:    rgba(12,18,40,0.92);
    --bp-surface-hover:    rgba(255,255,255,0.07);

    /* Glass */
    --bp-glass:            rgba(255,255,255,0.05);
    --bp-glass-md:         rgba(255,255,255,0.09);
    --bp-glass-border:     rgba(255,255,255,0.10);
    --bp-glass-border-hi:  rgba(255,255,255,0.22);

    /* Text */
    --bp-text:        #e2e8f5;
    --bp-text-muted:  #8892a8;
    --bp-text-active: #ffffff;

    /* Gradients */
    --g-brand:    linear-gradient(135deg, #00008B 0%, #3b5bdb 100%);
    --g-surface:  linear-gradient(135deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.02) 100%);
    --g-heading:  linear-gradient(135deg, #ffffff 0%, #93c5fd 100%);
    --g-kpi1:     linear-gradient(135deg, #00008B 0%, #3b5bdb 100%);
    --g-kpi2:     linear-gradient(135deg, #059669 0%, #10b981 100%);
    --g-kpi3:     linear-gradient(135deg, #b70000 0%, #ef4444 100%);
    --g-kpi4:     linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
    --g-kpi5:     linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);

    /* Semantic */
    --bp-success: #10b981;
    --bp-warning: #f59e0b;
    --bp-info:    #3b82f6;
    --bp-danger:  #ef4444;

    /* Shape */
    --bp-radius:    16px;
    --bp-radius-sm: 10px;
    --bp-radius-xs: 6px;

    /* Shadows */
    --bp-shadow:     0 4px 24px rgba(0,0,0,0.4);
    --bp-shadow-lg:  0 12px 60px rgba(0,0,0,0.55);
    --bp-shadow-glow: 0 0 40px rgba(59,91,219,0.2);

    /* Input */
    --bp-input-bg:     rgba(255,255,255,0.06);
    --bp-input-border: rgba(255,255,255,0.14);

    /* Transitions */
    --bp-transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────── Page Reset ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ─────────────────────────── Page Layout ─────────────────────────── */
.bp-body {
    background: var(--bp-bg);
    color: var(--bp-text);
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    /* Animated radial mesh background */
    background:
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(0,0,139,0.35) 0%, transparent 70%),
        radial-gradient(ellipse 60% 60% at 90% 100%, rgba(59,91,219,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(7,30,80,0.6) 0%, transparent 100%),
        #070b18;
}

.bp-body .navbar, .bp-body nav { display: none !important; }

.bp-wrapper { display: flex; min-height: 100vh; }

/* ─────────────────────────── Sidebar ─────────────────────────── */
.bp-sidebar {
    width: 268px;
    background: rgba(8,12,30,0.88);
    backdrop-filter: blur(28px) saturate(1.8);
    -webkit-backdrop-filter: blur(28px) saturate(1.8);
    border-right: 1px solid rgba(255,255,255,0.07);
    padding: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
}

/* Sidebar accent ribbon */
.bp-sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: var(--g-brand);
    opacity: 0.9;
}

.bp-sidebar-header {
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.bp-sidebar-header img {
    height: 32px;
    filter: brightness(1) drop-shadow(0 0 8px rgba(59,91,219,0.5));
}

.bp-sidebar-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    background: var(--g-heading);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.bp-nav { list-style: none; padding: 16px 12px; margin: 0; flex: 1; overflow-y: auto; }
.bp-nav li { margin-bottom: 2px; }
.bp-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--bp-radius-sm);
    color: var(--bp-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--bp-transition);
    position: relative;
}
.bp-nav a:hover {
    background: rgba(59,91,219,0.12);
    color: var(--bp-text-active);
}
.bp-nav a.active {
    background: rgba(59,91,219,0.18);
    color: var(--bp-text-active);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--ms-indigo);
}
.bp-nav a i { width: 20px; text-align: center; font-size: 1rem; opacity: 0.8; }
.bp-nav a.active i, .bp-nav a:hover i { opacity: 1; color: var(--ms-indigo); }

.bp-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.bp-sidebar-footer a {
    color: var(--bp-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--bp-transition);
}
.bp-sidebar-footer a:hover { color: var(--bp-text-active); }

/* ─────────────────────────── Main Content ─────────────────────────── */
.bp-main {
    flex: 1;
    margin-left: 268px;
    padding: 28px 32px;
    min-height: 100vh;
}

/* ─────────────────────────── Topbar ─────────────────────────── */
.bp-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.bp-topbar h1 {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0;
    background: var(--g-heading);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.bp-topbar-right { display: flex; align-items: center; gap: 14px; }

.bp-time-badge {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--bp-glass-border);
    backdrop-filter: blur(10px);
    padding: 7px 16px;
    border-radius: 24px;
    font-size: 0.78rem;
    color: var(--bp-text-muted);
}

.bp-menu-toggle {
    display: none;
    background: var(--bp-glass);
    border: 1px solid var(--bp-glass-border);
    border-radius: 10px;
    color: var(--bp-text);
    width: 44px; height: 44px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--bp-transition);
}
.bp-menu-toggle:hover { background: var(--bp-glass-md); }

/* ─────────────────────────── Sections ─────────────────────────── */
.bp-section { display: none; animation: bpFadeIn 0.4s ease; }
.bp-section.active { display: block; }

@keyframes bpFadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ─────────────────────────── KPI Cards ─────────────────────────── */
.bp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.bp-kpi-card {
    background: var(--g-surface);
    border: 1px solid var(--bp-glass-border);
    border-radius: var(--bp-radius);
    padding: 24px 22px;
    position: relative;
    overflow: hidden;
    transition: var(--bp-transition);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    cursor: pointer;
}

.bp-kpi-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--bp-radius);
    background: radial-gradient(ellipse 80% 80% at 80% 0%, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.bp-kpi-card:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: var(--bp-glass-border-hi);
    box-shadow: var(--bp-shadow-lg), var(--bp-shadow-glow);
}

.bp-kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--g-brand);
    opacity: 0;
    transition: opacity 0.3s;
}
.bp-kpi-card:hover::before { opacity: 1; }

.bp-kpi-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 18px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.bp-kpi-icon.blue   { background: linear-gradient(135deg, #1d4ed8, #3b82f6); color: #fff; }
.bp-kpi-icon.green  { background: linear-gradient(135deg, #059669, #34d399); color: #fff; }
.bp-kpi-icon.red    { background: linear-gradient(135deg, #b91c1c, #f87171); color: #fff; }
.bp-kpi-icon.yellow { background: linear-gradient(135deg, #b45309, #fbbf24); color: #fff; }
.bp-kpi-icon.purple { background: linear-gradient(135deg, #5b21b6, #a78bfa); color: #fff; }

.bp-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    color: var(--bp-text-active);
    letter-spacing: -0.03em;
}
.bp-kpi-label {
    font-size: 0.72rem;
    color: var(--bp-text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 6px;
    font-weight: 600;
}

/* ─────────────────────────── Glass Card ─────────────────────────── */
.bp-card {
    background: var(--g-surface);
    border: 1px solid var(--bp-glass-border);
    border-radius: var(--bp-radius);
    padding: 26px;
    margin-bottom: 22px;
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    box-shadow: var(--bp-shadow);
    position: relative;
    overflow: hidden;
}
.bp-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 50% at 80% 0%, rgba(255,255,255,0.04) 0%, transparent 60%);
    pointer-events: none;
    border-radius: var(--bp-radius);
}

.bp-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--bp-text-active);
}
.bp-card-title i {
    width: 34px; height: 34px;
    background: rgba(59,91,219,0.18);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--ms-indigo);
    font-size: 0.9rem;
}

/* ─────────────────────────── Charts ─────────────────────────── */
.bp-chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}
.bp-chart-container { position: relative; height: 300px; }

/* ─────────────────────────── Live Visitors ─────────────────────────── */
.bp-live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.bp-visitor-card {
    background: var(--bp-glass);
    border: 1px solid var(--bp-glass-border);
    border-radius: var(--bp-radius-sm);
    padding: 16px 18px;
    cursor: pointer;
    transition: var(--bp-transition);
    backdrop-filter: blur(16px);
}
.bp-visitor-card:hover {
    background: var(--bp-surface-hover);
    transform: translateY(-3px);
    border-color: var(--bp-glass-border-hi);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.bp-visitor-card .bp-live-dot {
    width: 8px; height: 8px;
    background: var(--bp-success);
    border-radius: 50%;
    display: inline-block;
    animation: bpPulse 2s ease-in-out infinite;
    margin-right: 8px;
}
@keyframes bpPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    50%       { opacity: 0.75; box-shadow: 0 0 0 8px rgba(16,185,129,0); }
}

.bp-visitor-info { font-size: 0.82rem; }
.bp-visitor-info strong { color: var(--bp-text-active); font-weight: 600; }
.bp-visitor-info .bp-visitor-meta { color: var(--bp-text-muted); font-size: 0.75rem; margin-top: 4px; }

/* ─────────────────────────── History Slide Panel ─────────────────────────── */
.bp-history-panel {
    position: fixed;
    top: 0; right: -440px; bottom: 0;
    width: 420px; max-width: 92vw;
    background: rgba(10,14,32,0.96);
    backdrop-filter: blur(32px) saturate(1.6);
    -webkit-backdrop-filter: blur(32px) saturate(1.6);
    border-left: 1px solid rgba(255,255,255,0.09);
    z-index: 200;
    transition: right 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -12px 0 60px rgba(0,0,0,0.6);
}
.bp-history-panel.open { right: 0; }

.bp-history-header {
    padding: 22px 26px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.bp-history-header h4 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--bp-text-active); }

.bp-history-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--bp-glass-border);
    border-radius: 8px;
    color: var(--bp-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--bp-transition);
}
.bp-history-close:hover { background: var(--bp-glass-md); color: var(--bp-text-active); }

.bp-history-list { padding: 16px 26px; }
.bp-history-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.82rem;
}
.bp-history-item:last-child { border-bottom: none; }
.bp-history-item .bp-hist-page { color: var(--bp-text-active); font-weight: 600; }
.bp-history-item .bp-hist-time { color: var(--bp-text-muted); font-size: 0.75rem; }

/* ─────────────────────────── Social Share Module ─────────────────────────── */
.bp-share-form { max-width: 700px; }
.bp-share-form .form-group { margin-bottom: 22px; }
.bp-share-form label {
    font-weight: 600;
    font-size: 0.83rem;
    color: var(--bp-text);
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.bp-share-form .form-control {
    background: var(--bp-input-bg) !important;
    border: 1px solid var(--bp-input-border) !important;
    color: var(--bp-text-active) !important;
    border-radius: var(--bp-radius-sm) !important;
    padding: 11px 16px !important;
    font-size: 0.9rem !important;
    transition: var(--bp-transition) !important;
    backdrop-filter: blur(10px);
}
.bp-share-form .form-control::placeholder { color: rgba(255,255,255,0.3); }
.bp-share-form .form-control:focus {
    border-color: var(--ms-indigo) !important;
    box-shadow: 0 0 0 3px rgba(59,91,219,0.2) !important;
    background: rgba(255,255,255,0.09) !important;
}
.bp-share-form select.form-control { appearance: auto; }

/* Social Preview Card */
.bp-share-preview {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(24px) saturate(1.5);
    border-radius: 18px;
    overflow: hidden;
    max-width: 520px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    transition: box-shadow 0.3s, transform 0.3s;
}
.bp-share-preview:hover {
    box-shadow: 0 16px 60px rgba(59,91,219,0.25);
    transform: translateY(-2px);
}
.bp-share-preview-img {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #050822 0%, #0a1040 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.15);
    font-size: 4rem;
    position: relative;
    overflow: hidden;
}
.bp-share-preview-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center;
    background: #050822;
}
.bp-share-preview-body {
    padding: 18px 22px 22px;
    background: rgba(6,10,28,0.8);
    border-top: 1px solid rgba(255,255,255,0.07);
}
.bp-share-preview-body h4 { margin: 0 0 6px; font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.4; }
.bp-share-preview-body p { margin: 0 0 8px; font-size: 0.83rem; color: rgba(255,255,255,0.6); line-height: 1.55; }
.bp-share-preview-body small { color: var(--ms-indigo); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

.bp-share-buttons {
    display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px;
}
.bp-share-btn {
    padding: 10px 20px;
    border-radius: var(--bp-radius-sm);
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: var(--bp-transition);
    letter-spacing: 0.01em;
}
.bp-share-btn:hover { transform: translateY(-3px); filter: brightness(1.15); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.bp-share-btn.facebook  { background: #1877f2; }
.bp-share-btn.x         { background: #111; border: 1px solid rgba(255,255,255,0.15); }
.bp-share-btn.linkedin  { background: #0a66c2; }
.bp-share-btn.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.bp-share-btn.tiktok    { background: #010101; border: 1px solid #25f4ee; }
.bp-share-btn.whatsapp  { background: #25d366; }
.bp-share-btn.copy      { background: rgba(255,255,255,0.08); border: 1px solid var(--bp-glass-border); }
.bp-share-btn.auto-publish { background: var(--g-brand); }

/* ─────────────────────────── Tables ─────────────────────────── */
.bp-card table {
    width: 100%;
    color: var(--bp-text);
    font-size: 0.83rem;
    border-collapse: separate;
    border-spacing: 0;
}
.bp-card table th {
    color: var(--bp-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.68rem;
    padding: 10px 14px;
    border-bottom: 1px solid var(--bp-glass-border);
}
.bp-card table td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}
.bp-card table tr:hover td { background: rgba(255,255,255,0.04); }

/* ─────────────────────────── Badges ─────────────────────────── */
.bp-badge {
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.bp-badge-new        { background: rgba(59,130,246,0.18); color: #93c5fd; }
.bp-badge-contacted  { background: rgba(245,158,11,0.18); color: #fcd34d; }
.bp-badge-qualified  { background: rgba(139,92,246,0.18); color: #c4b5fd; }
.bp-badge-converted  { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.bp-badge-archived   { background: rgba(100,116,139,0.18); color: var(--bp-text-muted); }
.bp-badge-requirements { background: rgba(59,130,246,0.18); color: #93c5fd; }
.bp-badge-demo       { background: rgba(245,158,11,0.18); color: #fcd34d; }
.bp-badge-signup     { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.bp-badge-general    { background: rgba(139,92,246,0.18); color: #c4b5fd; }

/* ─────────────────────────── Settings ─────────────────────────── */
.bp-settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 26px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding-bottom: 0;
}
.bp-settings-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--bp-text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--bp-transition);
}
.bp-settings-tab:hover { color: var(--bp-text-active); }
.bp-settings-tab.active {
    color: var(--bp-text-active);
    border-bottom-color: var(--ms-indigo);
}

.bp-settings-panel { display: none; }
.bp-settings-panel.active { display: block; animation: bpFadeIn 0.3s ease; }

.bp-settings-group { margin-bottom: 22px; }
.bp-settings-group h5 {
    font-size: 0.9rem;
    margin: 0 0 14px;
    color: var(--bp-text);
    font-weight: 700;
}
.bp-input-row {
    display: flex;
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
}
.bp-input-row .form-group { flex: 1; margin: 0; }

/* ─────────────────────────── AI Panel ─────────────────────────── */
.bp-ai-output {
    background: rgba(5,8,22,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--bp-radius-sm);
    padding: 18px;
    margin-top: 18px;
    min-height: 110px;
    white-space: pre-wrap;
    font-size: 0.85rem;
    color: var(--bp-text);
    line-height: 1.55;
}

/* ─────────────────────────── Global Inputs ─────────────────────────── */
.form-control {
    background: var(--bp-input-bg) !important;
    border: 1px solid var(--bp-input-border) !important;
    color: var(--bp-text-active) !important;
    border-radius: var(--bp-radius-sm) !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    transition: var(--bp-transition) !important;
}
.form-control::placeholder { color: rgba(255,255,255,0.28) !important; }
.form-control:focus {
    border-color: var(--ms-indigo) !important;
    box-shadow: 0 0 0 3px rgba(59,91,219,0.2) !important;
    background: rgba(255,255,255,0.08) !important;
    outline: none;
}

/* ─────────────────────────── Buttons ─────────────────────────── */
.bp-btn {
    padding: 10px 24px;
    border-radius: var(--bp-radius-sm);
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--bp-transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}
.bp-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.08), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}
.bp-btn:hover::after { opacity: 1; }
.bp-btn:active { transform: scale(0.98); }

.bp-btn-primary {
    background: var(--g-brand);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,139,0.35);
}
.bp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(59,91,219,0.45);
}

.bp-btn-danger {
    background: linear-gradient(135deg, #7f1d1d, #ef4444);
    color: #fff;
    box-shadow: 0 4px 16px rgba(183,0,0,0.3);
}
.bp-btn-danger:hover { transform: translateY(-2px); }

.bp-btn-ghost {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--bp-glass-border);
    color: var(--bp-text);
    backdrop-filter: blur(8px);
}
.bp-btn-ghost:hover {
    background: rgba(255,255,255,0.11);
    border-color: var(--bp-glass-border-hi);
    color: var(--bp-text-active);
}

.bp-btn-sm { padding: 5px 14px; font-size: 0.75rem; border-radius: var(--bp-radius-xs); }

/* ─────────────────────────── Leaderboard ─────────────────────────── */
.bp-lb-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 8px;
    background: var(--bp-glass);
    border: 1px solid var(--bp-glass-border);
    border-radius: var(--bp-radius-sm);
    transition: var(--bp-transition);
    backdrop-filter: blur(16px);
}
.bp-lb-row:hover {
    background: var(--bp-surface-hover);
    transform: translateX(5px);
    border-color: var(--bp-glass-border-hi);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.bp-lb-top {
    background: rgba(59,91,219,0.1);
    border-color: rgba(59,91,219,0.25);
    box-shadow: inset 0 0 0 1px rgba(59,91,219,0.15);
}
.bp-lb-rank  { min-width: 42px; text-align: center; font-size: 1.3rem; }
.bp-medal    { font-size: 1.5rem; }
.bp-medal:not(.gold):not(.silver):not(.bronze) { font-size: 0.9rem; color: var(--bp-text-muted); font-weight: 700; }

.bp-lb-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(59,91,219,0.2);
}
.bp-lb-avatar img { width: 100%; height: 100%; object-fit: cover; }

.bp-lb-info  { flex: 1; min-width: 0; }
.bp-lb-name  { font-weight: 700; font-size: 0.95rem; color: var(--bp-text-active); }
.bp-lb-expertise { font-size: 0.75rem; color: var(--bp-text-muted); }

.bp-lb-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.bp-lb-badge {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
}

.bp-lb-stats { text-align: right; min-width: 90px; }
.bp-lb-score { font-size: 1.35rem; font-weight: 800; color: var(--bp-text-active); letter-spacing: -0.02em; }
.bp-lb-score small { font-size: 0.65rem; color: var(--bp-text-muted); font-weight: 600; }
.bp-lb-detail { font-size: 0.72rem; color: var(--bp-text-muted); }

/* ─────────────────────────── Badges Grid ─────────────────────────── */
.bp-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
}

.bp-badge-card {
    background: var(--bp-glass);
    border: 1px solid var(--bp-glass-border);
    border-radius: var(--bp-radius);
    padding: 22px;
    text-align: center;
    transition: var(--bp-transition);
    backdrop-filter: blur(16px);
}
.bp-badge-card:hover { transform: translateY(-5px); border-color: var(--bp-glass-border-hi); box-shadow: var(--bp-shadow-lg); }

.bp-badge-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    width: 60px; height: 60px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.bp-badge-name { font-weight: 700; font-size: 0.9rem; color: var(--bp-text-active); margin-bottom: 4px; }
.bp-badge-desc { font-size: 0.72rem; color: var(--bp-text-muted); margin-bottom: 8px; line-height: 1.5; }
.bp-badge-earned-tag  { font-size: 0.72rem; font-weight: 700; color: var(--bp-success); }
.bp-badge-threshold   { font-size: 0.72rem; color: var(--bp-text-muted); font-style: italic; }
.bp-badge-locked      { opacity: 0.35; filter: grayscale(0.9); }
.bp-badge-locked:hover{ opacity: 0.55; }
.bp-badge-earned      { background: rgba(59,91,219,0.06); }

/* Tier colors */
.bp-tier-bronze .bp-badge-icon, .bp-tier-bronze.bp-lb-badge { background: rgba(205,127,50,0.2); color: #cd7f32; }
.bp-tier-silver .bp-badge-icon, .bp-tier-silver.bp-lb-badge { background: rgba(192,192,192,0.2); color: #d0d0d0; }
.bp-tier-gold   .bp-badge-icon, .bp-tier-gold.bp-lb-badge   { background: rgba(255,215,0,0.18); color: #ffd700; }
.bp-tier-platinum .bp-badge-icon, .bp-tier-platinum.bp-lb-badge { background: rgba(180,217,255,0.18); color: #b4d9ff; }

.bp-badge-earned.bp-tier-bronze  { box-shadow: 0 0 24px rgba(205,127,50,0.2); }
.bp-badge-earned.bp-tier-silver  { box-shadow: 0 0 24px rgba(192,192,192,0.15); }
.bp-badge-earned.bp-tier-gold    { box-shadow: 0 0 30px rgba(255,215,0,0.2); }
.bp-badge-earned.bp-tier-platinum{ box-shadow: 0 0 30px rgba(180,217,255,0.2); }

/* ─────────────────────────── Avatar / Profile ─────────────────────────── */
.bp-avatar-wrapper { position: relative; width: 130px; height: 130px; margin: 0 auto; }
.bp-avatar-img {
    width: 130px; height: 130px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(59,91,219,0.4);
    box-shadow: 0 0 0 4px rgba(59,91,219,0.12);
}
.bp-avatar-upload-btn {
    position: absolute; bottom: 4px; right: 4px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--g-brand);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    border: 2px solid var(--bp-bg);
    transition: var(--bp-transition);
    box-shadow: 0 4px 12px rgba(59,91,219,0.4);
}
.bp-avatar-upload-btn:hover { transform: scale(1.15); }

/* ─────────────────────────── Status select ─────────────────────────── */
.bp-status-select {
    background: var(--bp-input-bg) !important;
    border: 1px solid var(--bp-input-border) !important;
    color: var(--bp-text-active) !important;
    border-radius: var(--bp-radius-xs) !important;
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
}

/* ─────────────────────────── Referral Share Row ─────────────────────────── */
.bp-ref-share-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bp-ref-share-row .bp-share-btn { padding: 5px 9px; font-size: 0.73rem; border-radius: 6px; min-width: unset; }

/* ─────────────────────────── Analytics Bar ─────────────────────────── */
.bp-bar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
}
.bp-bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--ms-navy), var(--ms-indigo));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────── Landing Page ─────────────────────────── */
.bp-landing-body {
    background:
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(0,0,139,0.5) 0%, transparent 70%),
        radial-gradient(ellipse 60% 60% at 90% 100%, rgba(59,91,219,0.25) 0%, transparent 70%),
        #07091a;
    min-height: 100vh;
}
.bp-landing-section { padding: 60px 0 80px; }
.bp-landing-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(32px) saturate(1.6);
    -webkit-backdrop-filter: blur(32px) saturate(1.6);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 22px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    overflow: hidden;
}
.bp-landing-header {
    background: var(--g-brand);
    color: #fff;
    padding: 38px 34px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.bp-landing-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 80% at 50% 0%, rgba(255,255,255,0.12) 0%, transparent 60%);
}
.bp-landing-header h2 { margin: 14px 0 8px; font-size: 1.65rem; font-weight: 800; position: relative; }
.bp-landing-header p  { margin: 0 auto; opacity: 0.85; font-size: 0.9rem; max-width: 520px; position: relative; }

.bp-landing-form { padding: 34px; }
.bp-landing-form label {
    font-weight: 600; font-size: 0.82rem;
    color: var(--bp-text); margin-bottom: 6px;
    display: flex; align-items: center; gap: 6px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.bp-landing-form label i { color: var(--ms-indigo); }
.bp-landing-form .form-control {
    border: 1px solid var(--bp-input-border) !important;
    border-radius: 10px !important;
    padding: 11px 14px !important;
}

.bp-submit-btn {
    background: var(--g-brand) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 13px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    transition: all 0.3s !important;
    box-shadow: 0 6px 24px rgba(0,0,139,0.4) !important;
}
.bp-submit-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 32px rgba(59,91,219,0.5) !important;
}
.bp-back-btn {
    background: rgba(255,255,255,0.06) !important;
    color: var(--bp-text) !important;
    border: 1px solid var(--bp-glass-border) !important;
    border-radius: 10px !important;
    padding: 13px !important;
    font-weight: 600 !important;
}

/* Multi-step form */
.bp-steps { display: flex; justify-content: center; gap: 8px; padding: 20px 32px 0; flex-wrap: wrap; }
.bp-step {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; font-weight: 600;
    color: rgba(255,255,255,0.4);
    padding: 8px 16px; border-radius: 20px; transition: all 0.3s;
}
.bp-step span {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.1); color: var(--bp-text-muted);
    font-size: 0.75rem; font-weight: 800;
}
.bp-step.active { color: #fff; }
.bp-step.active span { background: var(--g-brand); color: #fff; box-shadow: 0 0 14px rgba(59,91,219,0.5); }
.bp-step.done span  { background: var(--bp-success); color: #fff; }

.bp-form-step { display: none; }
.bp-form-step.active { display: block; animation: bpFadeIn 0.3s ease; }

.bp-confirm-summary { margin-bottom: 26px; }
.bp-summary-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.9rem; color: var(--bp-text);
}

/* ─────────────────────────── DataTables Override ─────────────────────────── */
.bp-card .dataTables_wrapper { color: var(--bp-text) !important; }
.bp-card .dataTables_wrapper .dataTables_filter input,
.bp-card .dataTables_wrapper .dataTables_length select {
    background: var(--bp-input-bg) !important;
    border: 1px solid var(--bp-input-border) !important;
    color: var(--bp-text-active) !important;
    border-radius: 8px !important;
    padding: 7px 12px !important;
}
.bp-card .dataTables_info, .bp-card .dataTables_paginate { color: var(--bp-text-muted) !important; font-size: 0.82rem !important; }
.bp-card .paginate_button { color: var(--bp-text) !important; border-radius: 6px !important; }
.bp-card .paginate_button:hover { background: var(--bp-glass-md) !important; border-color: transparent !important; color: var(--bp-text-active) !important; }
.bp-card .paginate_button.current {
    background: var(--g-brand) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 10px rgba(59,91,219,0.4) !important;
}
.bp-card .buttons-excel { background: #166534 !important; color: #fff !important; border: none !important; border-radius: 6px !important; }
.bp-card .buttons-pdf   { background: #7f1d1d !important; color: #fff !important; border: none !important; border-radius: 6px !important; }
.bp-card .buttons-csv   { background: #1e3a5f !important; color: #fff !important; border: none !important; border-radius: 6px !important; }
.bp-card .buttons-print { background: rgba(255,255,255,0.08) !important; color: var(--bp-text) !important; border: 1px solid var(--bp-glass-border) !important; border-radius: 6px !important; }
.bp-card .dt-buttons { margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.bp-card .dt-button { padding: 6px 14px !important; font-size: 0.78rem !important; font-weight: 600 !important; cursor: pointer; transition: all 0.2s !important; }
.bp-card .dt-button:hover { filter: brightness(1.2) !important; transform: translateY(-1px); }

/* ─────────────────────────── Shares section ─────────────────────────── */
.bp-shares-list { margin-top: 22px; }

/* ─────────────────────────── Global scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─────────────────────────── Overlay ─────────────────────────── */
.bp-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 99; backdrop-filter: blur(4px); overflow-y: auto; }
.bp-overlay.active { display: flex; align-items: flex-start; justify-content: center; }

/* ─────────────────────────── Modals ─────────────────────────── */
.bp-modal {
    background: rgba(10,14,32,0.95);
    backdrop-filter: blur(28px) saturate(1.8);
    -webkit-backdrop-filter: blur(28px) saturate(1.8);
    border: 1px solid var(--bp-glass-border-hi);
    border-radius: var(--bp-radius);
    width: 600px;
    max-width: 90vw;
    margin: 60px auto;
    position: relative;
    box-shadow: var(--bp-shadow-lg);
    animation: bpModalIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 101;
}
@keyframes bpModalIn {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.bp-modal-header {
    padding: 22px 26px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.bp-modal-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bp-text-active);
    display: flex;
    align-items: center;
    gap: 10px;
}
.bp-modal-close {
    background: transparent;
    border: none;
    color: var(--bp-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--bp-transition);
}
.bp-modal-close:hover { color: var(--bp-danger); transform: scale(1.1); }
.bp-modal-body { padding: 26px; }

/* ─────────────────────────── Responsive ─────────────────────────── */
@media (max-width: 1024px) { .bp-chart-row { grid-template-columns: 1fr; } }

@media (max-width: 768px) {
    .bp-sidebar { transform: translateX(-100%); }
    .bp-sidebar.open { transform: translateX(0); }
    .bp-main { margin-left: 0; padding: 16px; }
    .bp-menu-toggle { display: flex; align-items: center; justify-content: center; }
    .bp-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .bp-live-grid { grid-template-columns: 1fr; }
    .bp-topbar { flex-wrap: wrap; gap: 10px; }
    .bp-topbar h1 { font-size: 1.3rem; }
    .bp-history-panel { width: 100%; right: -100%; }
}

@media (max-width: 480px) {
    .bp-kpi-grid { grid-template-columns: 1fr; }
    .bp-share-buttons { flex-direction: column; }
    .bp-steps { flex-direction: column; align-items: center; }
}
