:root {
    --ap-primary: #4f46e5;
    --ap-primary-light: #818cf8;
    --ap-primary-dark: #3730a3;
    --ap-bg: #f8fafc;
    --ap-card-bg: #ffffff;
    --ap-text-main: #0f172a;
    --ap-text-muted: #64748b;
    --ap-border: #e2e8f0;
    --ap-success: #10b981;
    --ap-pending: #f59e0b;
    --ap-glass: rgba(255, 255, 255, 0.7);
    --ap-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --ap-shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.ap-dashboard {
    font-family: 'Inter', sans-serif;
    background: var(--ap-bg);
    padding: 2.5rem;
    border-radius: 24px;
    color: var(--ap-text-main);
    box-shadow: var(--ap-shadow-lg);
    
    /* Break out of theme container for Full Width */
    width: 98vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -49vw;
    margin-right: -49vw;
    
    border: 1px solid var(--ap-border);
    box-sizing: border-box;
}

/* Header Section */
.ap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    gap: 2rem;
}

.ap-user-info h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(to right, var(--ap-primary-dark), var(--ap-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ap-subtitle {
    color: var(--ap-text-muted);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.ap-referral-link-box {
    background: var(--ap-card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--ap-border);
    box-shadow: var(--ap-shadow);
    flex-grow: 1;
    max-width: 450px;
    backdrop-filter: blur(8px);
}

.ap-referral-link-box label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ap-text-muted);
    margin-bottom: 0.75rem;
    display: block;
}

.ap-copy-input {
    display: flex;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid var(--ap-border);
}

.ap-copy-input input {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--ap-text-main);
    width: 100%;
}

.ap-btn-primary {
    display: inline-block;
    background: var(--ap-primary);
    color: #fff !important;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.ap-btn-primary:hover {
    background: var(--ap-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.ap-card-styled {
    background: white;
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: var(--ap-shadow-lg);
    border: 1px solid var(--ap-border);
    max-width: 500px;
    margin: 2rem auto;
}

.ap-card-styled .ap-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.ap-card-styled h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.ap-card-styled.ap-success {
    border-top: 6px solid var(--ap-success);
}

.ap-join-cta {
    font-size: 1.1rem;
    padding: 1rem 2rem;
    box-shadow: var(--ap-shadow);
}

.ap-btn-copy {
    background: var(--ap-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ap-btn-copy:hover {
    background: var(--ap-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

/* Tabs */
.ap-tabs {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 14px;
    margin-bottom: 2.5rem;
    width: fit-content;
}

.ap-tab-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--ap-text-muted);
}

.ap-tab-btn.active {
    background: var(--ap-card-bg);
    color: var(--ap-primary);
    box-shadow: var(--ap-shadow);
}

/* Stats Cards */
.ap-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.ap-stat-card {
    background: var(--ap-card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--ap-border);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.ap-stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 50%, rgba(79, 70, 229, 0.03) 50%);
    border-radius: 0 0 0 100px;
}

.ap-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--ap-shadow-lg);
}

.ap-stat-card.primary {
    border-top: 5px solid var(--ap-primary);
}

.ap-stat-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ap-text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ap-stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--ap-text-main);
}

.ap-stat-sub {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--ap-success);
    font-weight: 600;
}

/* Charts & Tables */
.ap-charts-section {
    background: var(--ap-card-bg);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--ap-border);
    margin-bottom: 3rem;
    height: 400px;
}

.ap-table-container {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--ap-border);
}

.ap-table th {
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    font-weight: 700;
    padding: 1.25rem;
}

.ap-table td {
    padding: 1.25rem;
    font-size: 0.9375rem;
}

.ap-status {
    padding: 0.4rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.8125rem;
}

.ap-actions {
    margin-top: 1.5rem;
}

.ap-small-text {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--ap-text-muted);
}

.ap-small-text a {
    color: var(--ap-primary);
    text-decoration: none;
    font-weight: 600;
}

.ap-small-text a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .ap-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .ap-referral-link-box {
        max-width: 100%;
    }
    .ap-dashboard {
        padding: 1.5rem;
        margin: 1rem;
    }
}
