/* ========================================
   CSS VARIABLES
   ======================================== */
   :root {
    --violet: #45066e;
    --violet-dark: #7C3AED;
    --violet: #45066e;
    --violet-dark: #7C3AED;
    --black: #000000;
    --white: #FFFFFF;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-900: #111827;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ========================================
   PRIMARY COLOR OVERRIDES
   ======================================== */
/* Override Bootstrap primary colors with pink */
.bg-primary {
    background-color: var(--violet) !important;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, var(--violet), var(--violet-dark)) !important;
}

.text-primary {
    color: var(--violet) !important;
}

.btn-primary {
    background-color: var(--violet) !important;
    border-color: var(--violet) !important;
}

.btn-primary:hover {
    background-color: var(--violet-dark) !important;
    border-color: var(--violet-dark) !important;
}

.navbar-dark.bg-primary {
    background-color: var(--violet) !important;
}

/* ========================================
   ADMIN PANEL LAYOUT
   ======================================== */
.admin-panel {
    background: #f8f9fa !important;
    padding-top: 70px !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-panel body {
    margin: 0 !important;
    padding: 0 !important;
}

.admin-container {
    min-height: calc(100vh - 70px);
}

/* ========================================
   TOP NAVIGATION
   ======================================== */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.5rem;
}

.brand-text {
    color: white;
}

/* Sidebar toggle button */
.sidebar-toggle {
    display: none;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.sidebar-toggle i {
    font-size: 1.2rem;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    background: white !important;
    height: 100vh !important;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
    position: fixed !important;
    width: 300px !important;
    left: 0 !important;
    top: 0 !important;
    overflow-y: auto !important;
    z-index: 1000 !important;
    display: block !important;
}

.sidebar-user {
    background: var(--violet) !important;
    padding: 30px 20px !important;
    text-align: center !important;
    color: white !important;
    border-radius: 0 !important;
    margin-top: 70px !important;
}

.user-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    color: white;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-id, .user-stage, .user-balance, .user-referrals {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 3px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-item {
    padding: 0 !important;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: var(--gray-50);
    color: var(--violet);
    border-left-color: var(--violet);
}

.sidebar-nav .nav-link.active {
    background: var(--violet);
    color: white;
    border-left-color: var(--violet-dark);
}

.sidebar-nav .nav-link i {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    padding: 30px !important;
    margin-left: 300px !important;
    min-height: calc(100vh - 70px) !important;
    width: calc(100% - 300px) !important;
    position: relative !important;
    z-index: 1 !important;
    display: flex;
    flex-direction: column;
}

/* Main content wrapper */
.admin-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ========================================
   DASHBOARD CARDS
   ======================================== */
.welcome-banner {
    background: linear-gradient(135deg, var(--violet), var(--violet-dark));
    color: white;
    padding: 2rem;
    border-radius: var(--radius-2xl);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.welcome-banner h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    color: white !important;
}

.welcome-banner p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.dashboard-stats-card {
    background: var(--white);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 100px;
}

.dashboard-stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--violet);
    border-radius: 20px 20px 0 0;
}

.dashboard-stats-card.card-black {
    background: var(--violet);
    color: white;
}

.dashboard-stats-card.card-black::before {
    background: var(--violet);
}

.dashboard-stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.dashboard-stats-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: var(--violet);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-stats-card.card-black .card-icon {
    background: var(--white);
}

.dashboard-stats-card .card-icon i {
    font-size: 1.25rem;
    color: var(--white);
}

.dashboard-stats-card.card-black .card-icon i {
    color: var(--violet);
}

.dashboard-stats-card .card-content {
    flex: 1;
    min-width: 0;
}

.dashboard-stats-card h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900) !important;
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.dashboard-stats-card.card-black h3 {
    color: var(--white) !important;
}

.dashboard-stats-card p {
    color: var(--gray-600) !important;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-stats-card.card-black p {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ========================================
   PROGRESS CARDS
   ======================================== */
.stage-progress-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.stage-progress-card h4 {
    color: var(--gray-900);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stage-progress-card h5 {
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.progress-bar-custom {
    background: var(--gray-200);
    border-radius: 25px;
    height: 30px;
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
}

.progress-fill {
    background: linear-gradient(90deg, var(--violet), var(--violet-dark));
    height: 100%;
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    transition: width 0.6s ease;
}

.referral-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.referral-stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
}

.referral-stat-item h5 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.referral-stat-item p {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
    text-transform: uppercase;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-violet {
    background: var(--violet);
    border-color: var(--violet);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-violet:hover {
    background: var(--violet-dark);
    border-color: var(--violet-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-violet i {
    font-size: 1.1rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Desktop - Sidebar always visible */
@media (min-width: 769px) {
    .sidebar {
        display: block !important;
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .sidebar-toggle {
        display: none !important;
    }
}

/* Mobile - Sidebar hidden by default */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px !important;
        z-index: 1060 !important;
        position: fixed !important;
        top: 0px !important;
        left: 0 !important;
        height: 100vh !important;

    }

    .sidebar-user {
        margin-top: 0px !important;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block !important;
        z-index: 1070 !important;
        position: relative !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 15px 10px;
        width: 100% !important;
    }
    
    .footer-section {
        margin-left: 0;
        width: 100%;
    }
    
    /* Mobile welcome banner improvements */
    .welcome-banner {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        border-radius: 15px;
    }
    
    .welcome-banner h2 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    .welcome-banner p {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    /* Mobile dashboard cards - horizontal layout */
    .dashboard-stats-card {
        margin-bottom: 1rem;
        padding: 1.25rem;
        border-radius: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
        display: flex;
        align-items: center;
        gap: 1rem;
        min-height: 90px;
    }
    
    .dashboard-stats-card h3 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
        line-height: 1.1;
    }
    
    .dashboard-stats-card p {
        font-size: 0.75rem;
        margin-bottom: 0;
        line-height: 1.2;
        letter-spacing: 0.3px;
    }
    
    .dashboard-stats-card .card-icon {
        width: 45px;
        height: 45px;
        border-radius: 12px;
        flex-shrink: 0;
    }
    
    .dashboard-stats-card .card-icon i {
        font-size: 1.1rem;
    }
    
    .dashboard-stats-card .card-content {
        flex: 1;
        min-width: 0;
    }
    
    /* Mobile grid improvements */
    .row.g-4 {
        margin: 0 -0.5rem;
    }
    
    .row.g-4 > [class*="col-"] {
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }
    
    /* Mobile stage progress cards */
    .stage-progress-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
        border-radius: 15px;
    }
    
    .stage-progress-card h4 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .stage-progress-card h5 {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }
    
    /* Mobile referral stats */
    .referral-stats {
    display: flex;
        flex-direction: column;
        gap: 0.8rem;
        margin: 1rem 0;
    }
    
    .referral-stat-item {
        text-align: center;
        padding: 0.8rem;
        background: var(--gray-50);
        border-radius: 12px;
        border: 1px solid var(--gray-200);
    }
    
    .referral-stat-item h5 {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }
    
    .referral-stat-item p {
        font-size: 0.8rem;
        margin: 0;
    }
    
    /* Mobile buttons */
.btn-violet {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
        border-radius: 12px;
    font-weight: 600;
    }
    
    /* Mobile progress bar */
    .progress-bar-custom {
        height: 20px;
        border-radius: 10px;
        margin: 1rem 0;
    }
    
    .progress-fill {
        border-radius: 10px;
        font-size: 0.8rem;
    }
    
    /* Mobile table responsiveness */
    .table-responsive {
        font-size: 0.85rem;
        border-radius: 10px;
        overflow: hidden;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.6rem 0.4rem;
        border: none;
    }
    
    .table-responsive thead th {
        background: var(--violet);
        color: white;
        font-weight: 600;
        font-size: 0.8rem;
    }
    
    /* Mobile form improvements */
    .form-control {
        border-radius: 10px;
        padding: 12px 15px;
        font-size: 0.95rem;
        border: 2px solid var(--gray-200);
    }
    
    .form-control:focus {
        border-color: var(--violet);
        box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25);
    }
    
    /* Mobile card improvements */
    .card {
        border-radius: 15px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
        border: none;
        margin-bottom: 1rem;
    }
    
    .card-header {
        border-radius: 15px 15px 0 0;
        padding: 1.25rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    /* Mobile spacing improvements */
    .mt-4 {
        margin-top: 1.5rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .py-3 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .admin-panel {
        padding-top: 60px;
    }
    
    .admin-container {
        min-height: calc(100vh - 60px);
    }
    
    .sidebar {
        height: 100vh;
        top: 0px;
    }
    
    /* Mobile sidebar overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1050 !important;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Mobile dashboard cards - override for very small screens */
    .dashboard-stats-card {
        margin-bottom: 1rem;
        padding: 1.25rem;
        min-height: 85px;
    }
    
    .dashboard-stats-card h3 {
        font-size: 1.4rem;
    }
    
    .dashboard-stats-card p {
        font-size: 0.7rem;
    }
    
    .dashboard-stats-card .card-icon {
        width: 40px;
        height: 40px;
    }
    
    .dashboard-stats-card .card-icon i {
        font-size: 1rem;
    }
    
    /* Mobile stage progress cards */
    .stage-progress-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .stage-progress-card h4 {
        font-size: 1.2rem;
    }
    
    /* Mobile referral stats */
    .referral-stats {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .referral-stat-item {
        text-align: center;
        padding: 1rem;
        background: var(--gray-50);
        border-radius: 10px;
    }
    
    /* Mobile buttons */
    .btn-violet {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
    
    /* Mobile table responsiveness */
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    .main-content {
        padding: 10px 8px;
    }
    
    .welcome-banner {
        padding: 1.25rem 0.8rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .welcome-banner h2 {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
        line-height: 1.1;
    }
    
    .welcome-banner p {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .dashboard-stats-card {
        padding: 1rem;
        margin-bottom: 0.8rem;
        border-radius: 12px;
    }
    
    .dashboard-stats-card h3 {
        font-size: 1.8rem;
        margin-bottom: 0.4rem;
        line-height: 1;
    }
    
    .dashboard-stats-card p {
        font-size: 0.8rem;
        margin-bottom: 0;
        line-height: 1.2;
    }
    
    .dashboard-stats-card .card-icon {
        width: 45px;
        height: 45px;
        margin-bottom: 0.6rem;
    }
    
    .dashboard-stats-card .card-icon i {
        font-size: 1.2rem;
    }
    
    .referral-stat-item h5 {
        font-size: 1.3rem;
        margin-bottom: 0.2rem;
    }
    
    .referral-stat-item p {
        font-size: 0.75rem;
    }
    
    .stage-progress-card {
        padding: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .stage-progress-card h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .stage-progress-card h5 {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
    }
    
    /* Mobile grid improvements */
    .row.g-4 {
        margin: 0 -0.3rem;
    }
    
    .row.g-4 > [class*="col-"] {
        padding: 0 0.3rem;
        margin-bottom: 0.8rem;
    }
    
    /* Mobile table improvements */
    .table-responsive {
        border: none;
        font-size: 0.75rem;
        border-radius: 8px;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.4rem 0.2rem;
        white-space: nowrap;
    }
    
    .table-responsive thead th {
        font-size: 0.7rem;
        padding: 0.5rem 0.3rem;
    }
    
    /* Mobile button improvements */
    .btn-violet {
        font-size: 0.85rem;
        padding: 10px 15px;
        border-radius: 10px;
    }
    
    /* Mobile progress bar */
    .progress-bar-custom {
        height: 18px;
        border-radius: 9px;
        margin: 0.8rem 0;
    }
    
    .progress-fill {
        border-radius: 9px;
        font-size: 0.75rem;
    }
    
    /* Mobile referral structure grid */
    .row .col-6 {
        margin-bottom: 0.4rem;
    }
    
    .row .col-6 .text-center {
        padding: 0.6rem 0.4rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }
    
    .row .col-6 .text-center strong {
        font-size: 0.8rem;
    }
    
    .row .col-6 .text-center small {
        font-size: 0.65rem;
    }
    
    /* Mobile form improvements */
    .form-control {
        padding: 10px 12px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    /* Mobile card improvements */
    .card {
        border-radius: 12px;
        margin-bottom: 0.8rem;
    }
    
    .card-header {
        border-radius: 12px 12px 0 0;
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Mobile spacing improvements */
    .mt-4 {
        margin-top: 1rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .py-3 {
        padding-top: 0.8rem !important;
        padding-bottom: 0.8rem !important;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-stats-card,
.stage-progress-card,
.welcome-banner {
    animation: fadeInUp 0.6s ease-out;
}

/* Staggered animation for cards */
.dashboard-stats-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-stats-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-stats-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-stats-card:nth-child(4) { animation-delay: 0.4s; }

/* Hover effects */
.dashboard-stats-card:hover .card-icon {
    transform: scale(1.1);
}

/* ========================================
   TREE PAGE BEAUTIFUL CARDS
   ======================================== */
/* Tree page container */
.genealogy-body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 80vh;
    padding: 2rem;
}

/* Tree structure styling */
.genealogy-tree {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 0;
}

.genealogy-tree ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.genealogy-tree li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Beautiful user cards */
.structure__block {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin: 1rem;
    min-width: 280px;
    max-width: 320px;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

.structure__block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--violet), var(--violet-dark));
    border-radius: 20px 20px 0 0;
}

.structure__block:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--violet);
}

/* User photo styling */
.structure__photo {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.structure__photo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--violet);
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.structure__block:hover .structure__photo img {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

/* User data styling */
.structure__data {
    text-align: center;
}

.pv__block {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    margin: 0.3rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.pv__block:hover {
    background: var(--violet);
    color: white;
    transform: translateX(5px);
}

.structure__data__login {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0.5rem 0;
    text-transform: capitalize;
}

.structure__data__login-text {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Action buttons */
.structure__data__pv {
    margin-top: 1rem;
}

.open_tree, .close_tree {
    background: linear-gradient(135deg, var(--violet), var(--violet-dark));
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    width: 100%;
    justify-content: center;
}

.open_tree:hover, .close_tree:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, var(--violet-dark), var(--violet));
}

.open_tree i, .close_tree i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.open_tree:hover i, .close_tree:hover i {
    transform: scale(1.2);
}

/* Status indicators */
.structure__block.paid-user {
    border-left: 4px solid var(--success);
}

.structure__block.free-user {
    border-left: 4px solid var(--warning);
}

.structure__block.paid-user::before {
    background: linear-gradient(90deg, var(--success), #059669);
}

.structure__block.free-user::before {
    background: linear-gradient(90deg, var(--warning), #d97706);
}

/* Tree connections */
.genealogy-tree li::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 2rem;
    background: var(--violet);
    opacity: 0.3;
}

.genealogy-tree > ul > li::before {
    display: none;
}

/* Loading state */
.structure__block.loading {
    opacity: 0.7;
    pointer-events: none;
}

.structure__block.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid var(--gray-300);
    border-top: 3px solid var(--violet);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Empty state */
.structure__block.empty {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 2px dashed var(--gray-300);
    color: var(--gray-500);
    text-align: center;
    padding: 2rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.structure__block.empty::before {
    display: none;
}

.structure__block.empty::after {
    content: '👥';
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Mobile responsive tree */
@media (max-width: 768px) {
    .genealogy-body {
        padding: 1rem;
    }
    
    .structure__block {
        min-width: 250px;
        max-width: 280px;
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .genealogy-tree ul {
        gap: 1rem;
    }
    
    .structure__photo img {
        width: 60px;
        height: 60px;
    }
    
    .structure__data__login {
        font-size: 1rem;
    }
    
    .pv__block {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 576px) {
    .structure__block {
        min-width: 200px;
        max-width: 250px;
        padding: 0.8rem;
    }
    
    .structure__photo img {
        width: 50px;
        height: 50px;
    }
    
    .open_tree, .close_tree {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* ========================================
   FOOTER LAYOUT
   ======================================== */
/* Footer should respect sidebar layout */
.footer-section {
    margin-left: 300px;
    width: calc(100% - 300px);
    transition: all 0.3s ease;
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
    .footer-section {
        margin-left: 0;
        width: 100%;
    }
}

/* ========================================
   EXTRA SMALL MOBILE SCREENS
   ======================================== */
@media (max-width: 480px) {
    .dashboard-stats-card {
        padding: 1rem;
        min-height: 80px;
        gap: 0.75rem;
    }
    
    .dashboard-stats-card h3 {
        font-size: 1.25rem;
    }
    
    .dashboard-stats-card p {
        font-size: 0.65rem;
        letter-spacing: 0.2px;
    }
    
    .dashboard-stats-card .card-icon {
        width: 35px;
        height: 35px;
        border-radius: 10px;
    }
    
    .dashboard-stats-card .card-icon i {
        font-size: 0.9rem;
    }
    
    .welcome-banner {
        padding: 1.25rem 0.75rem;
        margin-bottom: 1rem;
    }
    
    .welcome-banner h2 {
        font-size: 1.5rem;
    }
    
    .welcome-banner p {
        font-size: 0.9rem;
    }
}

/* ========================================
   UTILITIES
   ======================================== */
.text-muted {
    color: var(--gray-500) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--error) !important;
}

.text-info {
    color: var(--info) !important;
}

.bg-light {
    background: var(--gray-50) !important;
}

.bg-white {
    background: var(--white) !important;
}

.border {
    border: 1px solid var(--gray-200) !important;
}

.border-0 {
    border: none !important;
}

/* Spacing utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* User Status Badge */
.user-status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--violet);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-card {
    position: relative;
}

/* Tree Breadcrumb Navigation */
.tree-breadcrumb {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    border: 1px solid rgba(156, 39, 176, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tree-breadcrumb .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
}

.tree-breadcrumb .breadcrumb-item {
    font-weight: 500;
    color: #6c757d;
}

.tree-breadcrumb .breadcrumb-item a {
    color: var(--violet);
    font-weight: 600;
    transition: all 0.3s ease;
}

.tree-breadcrumb .breadcrumb-item a:hover {
    color: var(--violet-dark);
    transform: translateX(2px);
}

.tree-breadcrumb .breadcrumb-item.active {
    color: var(--violet);
    font-weight: 700;
}

.tree-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--violet);
    font-weight: bold;
    font-size: 1.2em;
}

/* Mobile Tree Layout */
@media (max-width: 768px) {
    .five-line-tree {
        padding: 1rem 0;
    }
    
    .tree-level {
        flex-direction: column;
        align-items: center;
        margin: 1rem 0;
    }
    
    /* Level 1 - Horizontal scrollable line */
    .tree-level:has(.user-node[data-line="1"]) {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 1rem 0;
        gap: 1rem;
        justify-content: flex-start;
        align-items: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--violet) transparent;
    }
    
    .tree-level:has(.user-node[data-line="1"])::-webkit-scrollbar {
        height: 6px;
    }
    
    .tree-level:has(.user-node[data-line="1"])::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .tree-level:has(.user-node[data-line="1"])::-webkit-scrollbar-thumb {
        background: var(--violet);
        border-radius: 3px;
    }
    
    /* User nodes in mobile */
    .user-node {
        flex-shrink: 0;
        min-width: 200px;
        max-width: 200px;
    }
    
    /* Connection lines for mobile */
    .tree-level:has(.user-node[data-line="1"])::before {
        content: '';
        position: absolute;
        top: -1rem;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(to right, var(--violet), transparent, var(--violet));
        z-index: 1;
    }
    
    /* Individual connection lines from main user to each referral */
    .user-node[data-line="1"]::before {
        content: '';
        position: absolute;
        top: -1rem;
        left: 50%;
        transform: translateX(-50%);
        width: 2px;
        height: 1rem;
        background: var(--violet);
        z-index: 2;
    }
    
    /* Main user card adjustments for mobile */
    .user-card.line-0 {
        margin-bottom: 2rem;
    }
    
    /* Empty slots in mobile */
    .empty-slot {
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 1rem;
    }
    
    .empty-slot i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
}
