/* Layout Styles */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation */
.navbar {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-color);
}

.nav-link.active {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 64px);
    padding: 2rem 0;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 28rem;
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Dashboard Styles */
.dashboard-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    background-color: #f8fafc;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2rem;
    position: relative;
    padding-left: 1rem;
}

.dashboard-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: #3b82f6;
    border-radius: 2px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e2e8f0;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dashboard-card-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.dashboard-card-header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1));
}

.dashboard-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
}

.dashboard-card-body {
    padding: 1.5rem;
    background: white;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.1rem;
}

.text-success {
    color: #10b981;
}

.text-error {
    color: #ef4444;
}

.link-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.link-container .form-input {
    flex: 1;
    font-size: 0.9rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #1e293b;
}

.copy-btn {
    white-space: nowrap;
    padding: 0.75rem 1.25rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.copy-btn:hover {
    background: #2563eb;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .link-container {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
    }
}

/* MLM Tree Styles */
.tree-container {
    padding: 2rem;
    overflow-x: auto;
}

.tree-node {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 0.5rem;
    min-width: 200px;
    text-align: center;
}

.tree-connector {
    position: relative;
    height: 2rem;
    border-left: 2px solid var(--border-color);
    margin: 0 auto;
    width: 2px;
}

.tree-level {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.tree-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Form Group Styling */
.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #1e293b;
}
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: #f8fafc;
    color: #1e293b;
}
.form-control:focus, .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.invalid-feedback {
    color: #ef4444;
    font-size: 0.875rem;
}

/* Modal Styling */
.modal-content {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal-header {
    border-bottom: 1px solid #e2e8f0;
}
.modal-footer {
    border-top: 1px solid #e2e8f0;
}

/* DataTables Pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #3b82f6 !important;
    border: none !important;
    background: none !important;
    /* padding: 0.5rem 1rem; */
    /* margin: 0 0.25rem; */
    border-radius: 6px;
    transition: background 0.2s;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #3b82f6 !important;
    color: #fff !important;
}

/* Admin Sidebar Styles */
.admin-layout {
    min-height: 100vh;
}
.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    position: relative;
    z-index: 100;
    transition: all 0.2s;
}
.sidebar-header {
    background: #f8fafc;
}
.sidebar-nav {
    padding: 0.5rem !important;
}
.admin-sidebar .nav-link {
    color: #1e293b;
    font-weight: 400;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: #198754;
    color: #fff;
}
.active-sidebar-background-color {
    background: #198754 !important;
    color: #fff;
}
.admin-sidebar .nav-item .collapse .nav-link {
    font-weight: 400;
    /* padding-left: 2rem; */
    /* font-size: 0.97rem; */
}

#downlineMenu {
    padding-left: 1rem !important;
}

.admin-sidebar .nav-item .collapse .nav-link:hover {
    background: #198754;
    color: #fff !important;
}
.admin-sidebar .fa-chevron-down {
    font-size: 0.85em;
    margin-left: auto;
    transition: transform 0.2s;
}
.admin-sidebar .nav-link[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}
@media (max-width: 991.98px) {
    .admin-sidebar {
        position: absolute;
        left: -260px;
        top: 0;
        height: 100vh;
        z-index: 1050;
        box-shadow: 2px 0 8px rgba(0,0,0,0.08);
    }
    .admin-sidebar.open {
        left: 0;
    }
    .admin-layout {
        flex-direction: column;
    }
}